Re: Import and execfile()

2008-01-12 Thread Mike Meyer
On Fri, 11 Jan 2008 20:55:07 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> wrote: > On Jan 11, 5:24 pm, Mike Meyer <[EMAIL PROTECTED]> > wrote: > > On Fri, 11 Jan 2008 14:05:11 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> > > wrote: > > > I maintain a few configuration files in Python syntax (ma

RE: Import and execfile()

2008-01-12 Thread lloyd
Hello, > I maintain a few configuration files in Python syntax (mainly nested > dicts of ints and strings) and use execfile() to read them back to > Python. This has been working great; it combines the convenience of > pickle with the readability of Python. So far each configuration is > conta

Re: Import and execfile()

2008-01-11 Thread George Sakkis
On Jan 11, 6:54 pm, Mitko Haralanov <[EMAIL PROTECTED]> wrote: > On Fri, 11 Jan 2008 14:05:11 -0800 (PST) > > George Sakkis <[EMAIL PROTECTED]> wrote: > > # trying to set the configuration: > > CFG = {} > > execfile('path/to/some_config.py', CFG) > > > Traceback (most recent call last): > > ... >

Re: Import and execfile()

2008-01-11 Thread George Sakkis
On Jan 11, 5:24 pm, Mike Meyer <[EMAIL PROTECTED]> wrote: > On Fri, 11 Jan 2008 14:05:11 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> > wrote: > > > I maintain a few configuration files in Python syntax (mainly nested > > dicts of ints and strings) and use execfile() to read them back to > > Pyt

Re: Import and execfile()

2008-01-11 Thread Mitko Haralanov
On Fri, 11 Jan 2008 14:05:11 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> wrote: > # trying to set the configuration: > CFG = {} > execfile('path/to/some_config.py', CFG) > > Traceback (most recent call last): > ... > ImportError: No module named master_config > > > I understand why this fails

Re: Import and execfile()

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 14:05:11 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> wrote: > I maintain a few configuration files in Python syntax (mainly nested > dicts of ints and strings) and use execfile() to read them back to > Python. This has been working great; it combines the convenience of > pic