> I'm trying to log the results of a command that I'm running via the
popen2
> module to a file, while at the same time displaying its progress on
the
> screen.
I think you need popen3...
> figure out a way to simultaneously display it to the screen, kind of
like
> how unix's "tee" utility works.
[EMAIL PROTECTED] wrote:
>
> Hi there -
>
> I'm trying to log the results of a command that I'm running via the
> popen2 module to a file, while at the same time displaying its progress
> on the screen. So, at the end of the run, I should have the entire
> output (stdout and stderr) on the scr
Hi,
Why don't you print it while you get it..?
import os, sys
logfile = open("logfile.txt", "r")
input, output = os.popen2("your command")
while True:
temp = output.read(1) #or whatever fits you, more bytes is faster
if not temp: //EOF reached
break
logfile.write(temp)
sys.st
Hi there -
I'm trying to log the results of a command
that I'm running via the popen2 module to a file, while at the same time
displaying its progress on the screen. So, at the end of the run, I should
have the entire output (stdout and stderr) on the screen, but also have
two file objects each