sort of a beginner question about globals

fred.dixon fred.dixon at gmail.com
Wed Apr 13 20:04:32 EDT 2005


this is what i am using to test with.
my program is not much more involved just longer
and with a GUI.
I did test it and everything works, just wondered if there was
something evil and bad about importing main.
#------------------------------------------------
 #global1.py
import global2
import global3
import sys

constant = 'dumb'
option = sys.argv[1:]
pass
#global2.func1()
a=global2.class1()
a.func1()
print newvar


#global2.py
import __main__
pass
class class1:
    def func1(self):
        __main__.newvar = "string"
        pass




More information about the Python-list mailing list