title: Python STDIN User Input Issue
body: <p><strong>Issue</strong></p>
  
  <p>Conflict with STDIN when executing these two functions. What would cause the second function to not read STDIN correctly? If the first function is not executed, the second function has no issue reading the input.</p>
  
  <p>To clear STDIN buffer I've tried: </p>
  
  <pre><code>'sys.stdin.flush'
  
  'tcflush(sys.stdin, TCIOFLUSH)'
  </code></pre>
  
  <p><strong>Python Code</strong></p>
  
  <pre><code>import sys, select
  
  def stdin_read():
  
      print "[stdin read] You must answer Y/N and press ENTER"
      sys.stdout.flush()
      response = sys.stdin.read(1)
      print "You said '{}'".format(response)
  
  
  def stdin_timeout():
  
      print "[stdin timeout] You must answer YES / NO in 10 seconds and press ENTER"
      sys.stdout.flush()
  
      sys.stdin.flush()
  
      i, o, e = select.select( [sys.stdin], [], [], 10 )
  
      if (i):
          print "You said '{}'".format(sys.stdin.readline().strip())
          exit(0)
      else:
          print "You said nothing!"
          exit(1)
  
  
  stdin_read()
  stdin_timeout()
  </code></pre>
  
  <p><strong>Python Output Both Functions:</strong></p>
  
  <pre><code>:~# python input.py
  [stdin read] You must answer Y/N and press ENTER
  n
  You said 'n'
  [stdin timeout] You must answer YES / NO in 10 seconds and press ENTER
  no
  You said ''
  :~# no
  -bash: no: command not found
  </code></pre>
  
  <p><strong>Python Output Second Function</strong></p>
  
  <pre><code>~# python input.py
  [stdin timeout] You must answer YES / NO in 10 seconds and press ENTER
  no
  You said 'no'
  </code></pre>