Launching Python from Python

Jay O'Connor oconnor at bioreason.com
Fri Jul 27 21:01:15 CEST 2001


Piet van Oostrum wrote:
> 
> >>>>> Jay O'Connor <oconnor at bioreason.com> (JO) writes:
> 
> JO> All,
> JO> I'm trying to launch another program from a Python program.  The other
> JO> program happens to be another Python program.  I thought spawnle would
> JO> be the proper place.  However, it doesn't seem to be working.
> 
> JO>     import os
> JO>     pid = os.spawnle (os.P_NOWAIT,
> JO>                     "c:\\python20\\python.exe",
> JO>                     ["c:\\james\\development\\python\\test.py"],
> JO>                     {"PYTHONPATH":"c:\\james\\python"})
> 

> So make it either:
> 
> pid = os.spawnle (os.P_NOWAIT,
>                 "c:\\python20\\python.exe",
>                 "python", "c:\\james\\development\\python\\test.py",
>                 {"PYTHONPATH":"c:\\james\\python"})

Yeah, that did it, thanks.


Take care,
Jay



More information about the Python-list mailing list