Using subprocess to log print statements of a command
<p>I am running a Transporter command, which prints a log of what is happening to the prompt. </p>

<p>How would I re-direct all the print statements to a separate file called <code>transporter_log.txt</code> in the same folder as the script is running from? Something like - </p>

<pre><code>log_file = open(PATH, 'w')
subprocess.call(shlex.split("/usr/local//iTMSTransporter -m verify...")
log_file.write(...)
</code></pre>
