Need help with "global" variables

Roman Suzi rnd at
Sun Jul 15 01:46:34 EDT 2001

On Sun, 15 Jul 2001, Nick Perkins wrote:

>Your modules are going to have to import the globals.  You could put them
>all in a separate file, call it "", and then in each file
>(including the 'main' file), you would have:
>from my_globals import *

This assumes globals are constants. If you want them to change,
you can put them to class/object:

class Dummy:

globs = Dummy()
globs.var1 = 1.23
globs.var2 = 2.34

BTW, globals and object attributes take more time to get than

Sincerely yours, Roman Suzi
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at _/
_/ Sunday, July 15, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "This is Borg. <ESC> is futile <CTRL> is inevitable" _/

More information about the Python-list mailing list