Invoking Python from Python

Jeffrey Schwab jeff at schwabcenter.com
Tue Nov 8 20:20:32 CET 2005


John Henry wrote:
> Hi all,
> 
> I have a need to create a Python script on the fly from another Python
> program and then execute the script so created.  Do I need to invoke
> Python through os.spawnl or is there a better way?

Could you import the generated script?  This might be the way to go if, 
e.g., you're generating a "template" configuration file that might 
subsequently be edited by a human being.



More information about the Python-list mailing list