[Tutor] Logging stdout and stderr

Connor.Smith@huntington.com Connor.Smith at huntington.com
Fri Jun 17 22:30:39 CEST 2005

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 with the 
contents of one of stdout and stderr.  I can figure out how to write the 
results to a file, and then process or log it, but what I can't do is 
figure out a way to simultaneously display it to the screen, kind of like 
how unix's "tee" utility works.

Can anyone help?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050617/8acb546f/attachment.htm

More information about the Tutor mailing list