global variables shared across modules

2005-09-09 Thread MackS
Hello everyone Consider the following two simple files. The first is my "program", the other a file holding some global variable definitions and code shared by this program and a "twin" program (not shown here): program1.py: from shared import * fun() print "at top level: " + glo

Re: global variables shared across modules

2005-09-09 Thread Patrick Maupin
MackS wrote: > print "inside fun(): " + global_var ... > How can I get the changed value to "persist" in such a way that it > isn't reset when control leaves fun()? Why is it even reset in the > first place? After all, the module has already been imported (and the > initialization of global_va