Re: [Tutor] Logging stdout and stderr

2005-06-18 Thread Alan G
> 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.

Re: [Tutor] Logging stdout and stderr

2005-06-18 Thread Kent Johnson
[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

Re: [Tutor] Logging stdout and stderr

2005-06-17 Thread Hugo González Monteverde
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

[Tutor] Logging stdout and stderr

2005-06-17 Thread Connor . Smith
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