popen3 on windows

J

John

Hello. Can anyone tell me how to get p.poll() or a workaound to work when
using popen3() on windows? I use python 2.3. I am trying to launch a
command window to execute a command and then check periodically to see if
the command has finished executing. If it has not finished after a given
amount of time, I want to close the process. Is this possible on windows?

p = win32pipe.popen3('command') will create the tuple of files p, but none
have a poll() attribute. p[1].read() will hang up if the command has not
finished. Any suggestions? The other alternative is that I use the above
to start the command and then use another os command to see if my process is
running in the background on windows. If it is, then perhaps I can close it
if it if need be.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top