subprocess 'wait' method causes .py program to hang.

Jeff Epler jepler at
Sat Mar 19 18:32:10 CET 2005

You can use PROC.poll() to find out whether the process has exited yet
or not (for instance, in a 'while' loop along with a delay).  I don't know
what facilities exist to forcibly terminate programs on Windows, though.
On Unix, os.kill() can be used to kill a process given its pid.  Perhaps
some of the functions in the 'win32process' module of win32all can help.

Here's an example for Windows written in C:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <>

More information about the Python-list mailing list