replacement for execfile

Scott David Daniels Scott.Daniels at Acm.Org
Tue May 26 11:16:47 EDT 2009


Alex Popescu wrote:
> "Steven D'Aprano" <steve at REMOVE.THIS.cybersource.com.au> wrote in
> news:pan.2007.07.29.03.39.34.703168 at REMOVE.THIS.cybersource.com.au: 
>> ... you're expecting the users to write working Python code, but
>> you think "import module" is too hard for them?
> 
> That was just a cherry on the cake. The most important part is that 
> through this mechanism the user will be able to configure the framework 
> through normal Python code (very simple API: 3 functions), and not 
> through .ini, .xml or other variants.

I think Steven's point is that you can tell the to define a module with,
for example a setup function.  You then import their module and run
their setup function.  They then have a straightforward environment,
and can, for example do straightforward unit tests on their code if
anything even slightly tricky might be wanted as support code.  I agree
with Steven; much nicer to ask them to define a particular module and go
names inside that module.


--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list