title: Redirecting stdin and stdout in .Net
body: <p>I'm trying to redirect stdin and stdout of a console application, so that I can interact with them via F#. However, depending on the console application the obvious code seems to fail.  The following F# code works for <code>dir</code> but fails (hangs) for <code>python</code> and <code>fsi</code>:</p>
  
  <pre><code>open System
  open System.Diagnostics
  
  let f = new Process()
  f.StartInfo.FileName &lt;- "python"
  f.StartInfo.UseShellExecute &lt;- false
  f.StartInfo.RedirectStandardError &lt;- true
  f.StartInfo.RedirectStandardInput &lt;- true
  f.StartInfo.RedirectStandardOutput &lt;- true
  f.EnableRaisingEvents &lt;- true
  f.StartInfo.CreateNoWindow &lt;- true
  f.Start()
  let line = f.StandardOutput.ReadLine()
  </code></pre>
  
  <p>This hangs for python but works for dir. </p>
  
  <p>Does this have do with python and fsi using readline or am I making an obvious mistake?  Is there a work around that would allow me to interact with fsi or python REPL from F#?</p>