views:

753

answers:

1

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

+2  A: 

You can do this with subprocess.PIPE.

You can find some sample code here.

Dave Webb