Implementation of popen() with timeout

Mark Hammond MarkH at
Mon Jul 2 14:07:19 CEST 2001

Tom Harris wrote:

> I want to use one of the popen() functions to call an external program and
> capture the output, but I would like to have the facility to kill the
> external program if it does not complete within a specific time.
> Unfortunately I am using NT. Options appear to be to use the Win32 API to
> write my own, as the popen source looks fierce code. Any ideas?

You probably do need to roll your own.  If you use the win32 extensions, 
you could write it in Python making things smaller, and not providing 
the multitude of redirection options that popen supports will make it 
quite a bit simpler.


More information about the Python-list mailing list