On Feb 14, 11:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hello,
>
> I searched on Google and in this Google Group, but did not find any
> solution to my problem.
>
> I'm looking for a way to output stdout/stderr (from a subprocess or
> spawn) to screen and to at least two different files.
>
> eg.
> stdout/stderr -> screen
> stdout -> log.out
> stderr -> log.err
>
> and if possible
> stdout/stderr -> screen and log.txt
>
> 3 files from stdout/stderr

I'd derive a class from file, overwrite it's write() method to send a
copy to the log, and then assign sys.stdout = newFile(sys.stdout).
Same for stderr.





-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to