title: Reading Input till User Stops
body: <p>What if In <strong>Python 3.4</strong> I want to do read values <em>(here int)</em> till the user give input.
  Like this <em>C-code</em></p>
  <pre><code>while( scanf(&quot;%d&quot;, &amp;no) )
      {
       printf(&quot;%d&quot; , no);
  }
  </code></pre>
  <p>I tried something like :</p>
  <pre><code>inp = input()
  while inp != '':
     print(int(inp))
     inp = input()
  </code></pre>
  <p>This above python code worked as long as I input manually from terminal and ended input with <em>enter or newline</em></p>
  <p>But it throw : <strong>EOFError: EOF when reading a line</strong> when i read from the  stdin in linux terminal using:</p>
  <pre><code>python3.4 filename.py &lt; input
  </code></pre>
  <p>if the <em>input</em> file don't contain a trailing <em>newline</em>.</p>
  <h3>Edit:</h3>
  <p>Am using this method now, and waiting for some other ways.</p>
  <pre><code> import sys
  
   for line in sys.stdin:
       do_anything()   #here reading input
   # End here
   else_whatever()     #just passing here
  </code></pre>