execfile in global scope

tooper googlenews at tooper.org
Wed Aug 24 06:52:41 EDT 2005


What about :

globdict= globals()

def changevar():
	global globdict
	execfile("changevar.py",globdict)

x = 111   # global var
changevar() 
print x   # returns 111 instead of 555




More information about the Python-list mailing list