title: Real time output of subprocess.popen() and not line by line
body: <p>I'm currently rewriting a little wrapper program in python that I once wrote in C++. It extracts files from a file and boxes them in another format.</p>
  
  <p>In C++ the output from the system commands I need to run was "real time" i.e the status bar and the percentage indicator of some commands where shown in real time. With python I get each 'percent' dumped on the screen individually (because I read it line by line). Here's an example: Thats how a status bar looks in the python version (this goes on until 100). In C++ it does update itself though.</p>
  
  <pre><code>| (02/100)\rImporting AVC-H264: |                    | (03/100)\rImporting AVC-H264: |                       | (04/100)\rImporting AVC-H264: |=
  </code></pre>
  
  <p>Thats the corresponding python code:</p>
  
  <pre><code>p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  for line in iter(p.stdout.readline, ""):
     print line,
  </code></pre>
  
  <p>Any ideas on how I could make it look like in C++ ?</p>