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

Jeff Epler jepler at unpythonic.net
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:
    http://win32.mvps.org/processes/fkill.html

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050319/21afa7f7/attachment.pgp>


More information about the Python-list mailing list