I have a small python script which invokes an external process using subprocess. I want to redirect stdout and stderr to both a log file and to the terminal.
How can this be done?
You can do this with subprocess.PIPE.
You can find some sample code here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With