[Tutor] importing constants

R. Alan Monroe R. Alan Monroe" <amonroe@columbus.rr.com
Sun Feb 9 18:38:57 2003


I have a project consisting of a main file and two modules. If I want
to set up a new third module file establishing some constants, is it
safe to re-import it multiple times, once in each file and module? Are
there any side-effects to doing that?

Basically I want to define state values such as:
idle=1
attacking=2
attacked=3
And only have to define them in one place, to eliminate errors where
they might be accidentally be defined differently in different
modules. Later they will be used as dict keys. a[idle]=[1,2,3] etc.


Alan