Question about namespaces and import. How to avoid calling os.system

Jeff Epler jepler at unpythonic.net
Fri Jul 22 21:38:50 CEST 2005


In main.py, execfile("gen.py")

or

In gen.py, have something like
    from __main__ import env_params

or

In main.py, have something like
    import __builtins__; __builtins__.env_params = env_params

or

call a function in the gen.py with env_params as a parameter
    import gen
    gen.do(env_params)

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050722/0e6eb380/attachment.sig>


More information about the Python-list mailing list