output to console and to multiple files

Gabriel Genellina gagsl-py at yahoo.com.ar
Wed Feb 14 20:52:52 EST 2007


En Wed, 14 Feb 2007 19:28:34 -0300, nathan.shair at gmail.com  
<nathan.shair at gmail.com> escribió:

> I'm looking for a way to output stdout/stderr (from a subprocess or
> spawn) to screen and to at least two different files.

Look at the tee command. If you control the subprocess, and it's written  
in Python, using the Python recipes would be easier and perhaps you have  
more control.
But if you can't modify the subprocess, you'll have to use tee.

-- 
Gabriel Genellina




More information about the Python-list mailing list