How to replicate tee behavior in python when using subprocess?

Posted by Sorin Sbarnea on Stack Overflow See other posts from Stack Overflow or by Sorin Sbarnea
Published on 2010-06-08T11:36:13Z Indexed on 2010/06/08 11:42 UTC
Read the original article Hit count: 263

Filed under:
|
|
|
|

I'm looking for a Python solution that will allow me to save the output of a command in a file without hiding it from the console.

Requirements

  • Python solution (not calling tee, it is not available under Windows)
  • to work when calling external programs (subprocess)
  • to work for both stderr and stdout

© Stack Overflow or respective owner

Related posts about python

Related posts about subprocess