Need help with "global" variables

Steve Holden sholden at holdenweb.com
Mon Jul 16 09:09:55 EDT 2001


"Nick Perkins" <nperkins7 at home.com> wrote in message
news:co847.478507$eK2.99254456 at news4.rdc1.on.home.com...
> Your modules are going to have to import the globals.  You could put them
> all in a separate file, call it "my_globals.py", and then in each file
> (including the 'main' file), you would have:
> from my_globals import *
>
>
This would not be a good idea. Each module would create its own copy of the
imported globals, meaning that one module would not see changes made by
another because each would be modifying its own copy. And, in fact, this is
another good reason why one should avoid

    from module import *

unless one is very sure one knows what one is doing.

since-i-frequently-don't-i-avoid-it-like-the-plague-ly y'rs  - steve
--
http://www.holdenweb.com/








More information about the Python-list mailing list