title: Python3 : Using input() how to Read Multiple Lines from pipe (stdin)?
body: <p>im just curious while learning python3 and didn't found any good explanation on the web, neither here to my question. </p>
  
  <p>reading about input() it says "reads from stdin" so i thought i might experiment and try to use it to read from pipe. and so it does! but only ONE LINE (till EOL). So the next question that came up was</p>
  
  <p>how to read multiple lines from pipe (stdin) using input() ?</p>
  
  <p>i found sys.stdin and used sys.stdin.isatty() to determine if stdin is bound to a tty or not, assuming that if not bound to tty the data is coming from pipe. and so i also found and used successfully sys.stdin.readlines() too to read multiple lines. </p>
  
  <p>but just for my curiosity , is there a way to achieve the same by using the plain input() function ?? so far i didn't found something "to test" if stdin contains more lines without blocking my program.</p>
  
  <p>sorry if all this makes no sense to you.</p>
  
  <p>this is my experimenting code so far without input():</p>
  
  <pre><code>import sys
  
  if sys.stdin.isatty(): # is this a keyboard?
      print(  "\n\nSorry! i only take input from pipe. " 
              "not from a keyboard or tty!\n"
              "for example:\n$ echo 'hello world' | python3 stdin.py"
              ""
              ""
              )
  else:
      print ( "reading from stdin via pipe : \n ")
  
      for line in sys.stdin.readlines():
          print(line, end="")
  #   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can these two lines be replaced with 
  #   some construction using plain old input() ? 
  </code></pre>