title: Python subprocess output to stdout
body: <p>I am using the subprocess module to run binaries from python.</p>
  
  <p>To capture the output produced by the binary, I am using:</p>
  
  <pre><code>proc = subprocess.Popen (command_args, shell=False, stdout=subprocess.PIPE)
  out = proc.communicate()[0]
  #print the output of the child process to stdout
  print (out)
  </code></pre>
  
  <p>What this does is print the output of the process AFTER it has finished executing. Is there anyway I can print this output to stdout WHILE the program is executing? I really need to see what the output is because these programs can run for a long time.</p>
  
  <p>Thanks for the help.</p>