En Mon, 08 Sep 2008 13:35:21 -0300, <[EMAIL PROTECTED]> escribió:
cmd = subprocess.Popen([batchFilePath], \
shell = True, \
stdin = subprocess.PIPE,
stdout = subprocess.PIPE, \
stderr = subprocess.PIPE \
)
cmd.stdin.close()
outPipe, errPipe = PipeThread(cmd.stdout),
PipeThread(cmd.stderr)
outPipe.run(), errPipe.run()
retcode = cmd.wait()
out, err = outPipe.getOutput(), errPipe.getOutput()
Although, this solved my problem. But I know there is no need for using
threading in this problem. This problem could've been solved just by the
subprocess module.
I'm unnecessarily using the threading module.
Not only that, you're misusing the Thread class. To actually create a
separate execution thread, you should call outPipe.start() instead of
outPipe.run() (same for errPipe).
Note that if your batch file emits a large output it really may be
necesary to use a separate thread to read the output.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list