Hi,
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?
Thanks,
Udi
Hi,
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?
Thanks,
Udi
You can do this with subprocess.PIPE
.
You can find some sample code here.