J
John Taylor
I have a class that has this code in it:
def __init__(self,Site):
self.Site = Site
import_cmd = "from regexpr_%d import *" % ( int(self.Site.id) )
exec( import_cmd )
print AGENT # fails, NameError: global name 'AGENT' is not defined
The regexpr_1.py file, for example, has the line:
AGENT="Mozilla"
After the exec() command is ran, how to I access varaibles defined in
the regexpr_%d file?
Thanks,
John
def __init__(self,Site):
self.Site = Site
import_cmd = "from regexpr_%d import *" % ( int(self.Site.id) )
exec( import_cmd )
print AGENT # fails, NameError: global name 'AGENT' is not defined
The regexpr_1.py file, for example, has the line:
AGENT="Mozilla"
After the exec() command is ran, how to I access varaibles defined in
the regexpr_%d file?
Thanks,
John