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

2005-07-22 Thread Patricia J. Hawkins
> "PN" == Pekka Niiranen <[EMAIL PROTECTED]> writes: PN> Hi there, PN> I have two scripts. The first "main.py" sets some variables PN> and then imports another called "gen.py". The idea is to PN> provide "main.py" that defines some paths, variables etc. PN> without using Windows environment va

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

2005-07-22 Thread Jeff Epler
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_p

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

2005-07-22 Thread Pekka Niiranen
Thanks, I will analyse these 4 options and select the most suitable since there are other issues involved too, like "the "main.py" reads contents of a file to a list that gets passed to the "gen.py" with dictionary "env_params"". I try to avoid parsing the contents of the file both in "main.py" an

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

2005-07-22 Thread Pekka Niiranen
Hi there, I have two scripts. The first "main.py" sets some variables and then imports another called "gen.py". The idea is to provide "main.py" that defines some paths, variables etc. without using Windows environment variables. Various other "hackers" will make additional Python scripts (subrout