title: Output from py2exe converted program gets received all at once
body: <p>I have made a python console script, and converted it to a .exe with py2exe (I have used the <code>console = ['test.py']</code> line in my setup file).</p>
  
  <p>The program parses a file, and during the parse it prints out how much of the file it has parsed. Typical output would be:</p>
  
  <pre><code>Processing (currently at 1%)
  Processing (currently at 4%)
  </code></pre>
  
  <p>etc.
  When running the file in a <em>cmd window</em> it works just as expected.</p>
  
  <p>I have also created a very small C# WPF program that just runs the parser:</p>
  
  <pre><code>Process p = new Process();
  p.StartInfo = new ProcessStartInfo(@"C:\temp\test.exe");
  p.StartInfo.RedirectStandardOutput = true;
  p.StartInfo.UseShellExecute = false;
  p.StartInfo.CreateNoWindow = true;
  
  p.OutputDataReceived += new DataReceivedEventHandler(p_OutputDataReceived);
  
  Task t = new Task(() =&gt;
  {
      p.Start();
      p.BeginOutputReadLine();
      p.WaitForExit();
      p.Close();
  });
  t.Start();
  </code></pre>
  
  <p>The <code>p_OutputDataReceived</code> handler just sends the received output to a textbox. This works and I have tested it on other programs, and there I get the output from the program when I expect.</p>
  
  <p><strong>However</strong> when I run my parser (the one created with <em>py2exe</em>) I get all outputs just after the parser has finished. So in the end I get all the correct output, but I get them all at the same time... </p>
  
  <p>(note, I don't get one big output, but rather all the expected outputs but still, all at the same time)</p>
  
  <hr>
  
  <p>So to be perfectly clear here:</p>
  
  <ul>
  <li>If I run the parser from the command window, I get the outputs one by one</li>
  <li>I have tested to run a C# console program instead of the py2exe generated program and that works (I get the outputs one by one)</li>
  </ul>