Hello Everyone,
I have been using this piece of code to start an
exec and "process" its stdout/stderror
import sys
import popen2 executable = r'execfile -arg1 -arg2'
r, w, e = popen2.popen3(executable) r.flush() w.flush() e.flush() x=0
# just print the 1000 first lines
while x<1000: sys.stdout.write(e.readline()) sys.stdout.flush() sys.stdout.write(r.readline()) sys.stdout.flush() whenever running this code, the process starts up
fine, but no print occurs as the exec is running.
Somehow, the print results shows up only when the
process is stopped or when resuming ( thru the windows task list).
is there a way to get the print to show its results
as as it is trapped by open3() function ( namely realtime printing
).
Does someone would have a solution for this
problem?
Tx in advance for your help.
Dave.
|
-- http://mail.python.org/mailman/listinfo/python-list