M
M-a-S
I'd like to parametrize a module. That is, to set and pass
some values into the module, while it is being imported.
I tried this:
# sub_1.py -- main program
extern = "OK"
import sub_2
print sub_2.noway # prints 'no extern' :-(
# EOF
# sub_2.py -- parametrized module, parameter is the 'extern' var
try:
noway = extern
except:
noway = 'no extern'
# EOF
You can guess, it doesn't work.
How can I pass the parameter? Can I?
M-a-S
some values into the module, while it is being imported.
I tried this:
# sub_1.py -- main program
extern = "OK"
import sub_2
print sub_2.noway # prints 'no extern' :-(
# EOF
# sub_2.py -- parametrized module, parameter is the 'extern' var
try:
noway = extern
except:
noway = 'no extern'
# EOF
You can guess, it doesn't work.
How can I pass the parameter? Can I?
M-a-S