execvp on Windows

Sandeep Gupta sandeep182 at hotmail.com
Mon Jul 1 13:46:00 EDT 2002


On Linux, os.execvp(executable, args) replaces the current process, while on
Windows, it seems to spawn a new process and then complete the current
process.  On Windows, this means I get back the command prompt followed by
the output of my executable.
For example,
======================
D:\>python
Python 2.2.1 (#34, Apr  9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.execvp("python",["python"])

D:\>Python 2.2.1 (#34, Apr  9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
======================
On Windows, is there any way to delay the completion of the first process
until the execvp executable returns?  One idea is to use os.spawn*, but I
was looking for others.

Thanks
Sandeep





More information about the Python-list mailing list