[python-win32] How to monitor the stdout/stderr of somecmd.ex e

Tim Golden tim.golden at viacom-outdoor.co.uk
Fri Jun 25 11:41:57 EDT 2004


| I'd like to write a python program that will monitor the stdout/stderr
| of an executable (somecmd.exe) running on W2K. (simulated by 
| sometask.py
| as below) I'm trying to react to it's output *as it is happening* (eg.
| thru monitor_sometask.py) by using win32pipe, but I find that I'm only
| getting the pipe's output too long after the fact. How can I 
| monitor the
| output of somecmd.exe as it happens ? Thanks in advance.

Haven't followed this thread (so apologies if someone's suggested
this) but have you looked at Peter Astrand's Process/popen5 module:

http://www.lysator.liu.se/~astrand/popen5/

It looks as though it will do what you want, although
I freely admit I haven't tried it myself.

TJG


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-win32 mailing list