title: Using input redirection command ("<") in IPython
body: <p>In windows command line, I am using the <a href="https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx?mfr=true" rel="nofollow">redirection operator ("&lt;")</a> to read input from a file. To run my python module, I would do something like:</p>
  
  <p><code>python myscript.py &lt;input.txt</code></p>
  
  <p>In <code>myscript.py</code>, I am using <code>sys.stdin.readline()</code> to read the input stream, something like:</p>
  
  <pre><code>def main(argv):
      line = sys.stdin.readline() 
      while line:
          doSomething()
          line = sys.stdin.readline()
  
  if __name__ == "__main__": 
      main(sys.argv)
  </code></pre>
  
  <p>This works find on the command line. </p>
  
  <p>Is there a way to use the redirection command in IPython? I want to debug the file. Thanks.</p>
  
  <p>I am running Python 3.5.1:: Anaconda 2.5.0 on Win64.</p>