title: Displaying subprocess output to stdout and redirecting it
body: <p>I'm running a script via Python's subprocess module. Currently I use:</p>
  
  <pre><code>p = subprocess.Popen('/path/to/script', stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  result = p.communicate()
  </code></pre>
  
  <p>I then print the result to the stdout. This is all fine but as the script takes a long time to complete, I wanted real time output from the script to stdout as well. The reason I pipe the output is because I want to parse it.</p>