Running another python interpreter

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri Oct 19 20:48:04 EDT 2007


--- Simon Pickles <sipickles at hotmail.com> escribió:

> os.spawnl(os.P_NOWAIT, sys.executable,
> sys.executable, "gateway.py")
>... works but both process output to the same
> interpreter window. Is there a way to run another
> interpreter window containing gateway.py?

Use the subprocess module, passing CREATE_NEW_CONSOLE into creationflags:

subprocess.call([sys.executable, "gateway.py", "other", "arguments"],
                 creationflags = subprocess.CREATE_NEW_CONSOLE)

-- 
Gabriel Genellina




More information about the Python-list mailing list