Don't understand global variables between modules

Bart van Deenen bvdeenen at xs-four-all.nl.invalid
Wed Feb 23 13:57:33 EST 2005


Fredrik Lundh <fredrik at pythonware.com> wrote:

> because running a script isn't the same thing as importing it.  try adding
> "print __name__" lines before your other print statements so you can see
> who's printing what.
> 
> > Is there more than one global space?
> 
> in this case, there are more module namespaces than you think.
> this page might help (especially the "Using Modules as Scripts" section):
>     http://effbot.org/zone/import-confusion.htm

Thanks for your answer, and also thanks for effbot. Lots of good tips. 

Bart



More information about the Python-list mailing list