using 'global' across source files.

Duncan Booth duncan at rcp.co.uk
Wed Jan 3 05:21:05 EST 2001


bram at sara.nl (Bram Stolk) wrote in <3A52EE2C.32432EF5 at sara.nl>:

>And because I can do:
>dir(__builtins__)
>
>I thought, why the heck doesn't dir(__main__) work?
>

Did you try importing the __main__ module before referring to it?:
   import __main__
   dir(__main__)




More information about the Python-list mailing list