title: How do I get 'real-time' information back from a subprocess.Popen in python (2.5)
body: <p>I'd like to use the subprocess module in the following way:</p>
  
  <ol>
  <li>create a new process that potentially takes a long time to execute.  </li>
  <li>capture <code>stdout</code> (or <code>stderr</code>, or potentially both, either together or separately) </li>
  <li>Process data from the subprocess <strong>as it comes in,</strong> perhaps firing events on every line received (in wxPython say) or simply printing them out for now.</li>
  </ol>
  
  <p>I've created processes with Popen, but if I use communicate() the data comes at me all at once, once the process has terminated.  </p>
  
  <p>If I create a separate thread that does a blocking <code>readline()</code> of <code>myprocess.stdout</code> (using <code>stdout = subprocess.PIPE</code>)  I don't get any lines with this method either, until the process terminates. (no matter what I set as bufsize)</p>
  
  <p>Is there a way to deal with this that isn't horrendous, and works well on multiple platforms?</p>