> Just wirte test code ! variables.py:
myvar = 5 print myvar foo.py: from variables import * def PrintVar(): print myvar bar.py: from variables import * from foo import * print myvar myvar = 2 print myvar PrintVar() "python bar.py" output: 5 5 2 5 ... which is what I was expecting, but not what I want. Obviously, each import is creating its own instance of the variable. What I need is a way to change myvar from within "bar.py" so that PrintVar() returns the new value, even though it's in a different module. -- http://mail.python.org/mailman/listinfo/python-list