title: Python kbhit() problems
body: <p>I'm trying to write a very simple program that will wait for x seconds before checking to see it a key has been pressed then, depending on this outcome will go into a different loop further down the code. I have this code:</p>
  
  <pre><code>import msvcrt
  import time
  import sys
  
  time.sleep(1)
  if msvcrt.kbhit():
      sys.stdout.write('y')
  else:
      sys.stdout.write('n')
  </code></pre>
  
  <p>So I press any key when it first starts (making kbhit ==true) but it always just falls to the second statement and prints 'n'. 
  Any suggestions what I'm doing wrong?</p>
  
  <p>{Using Python 2.7 and IDLE}</p>
  
  <p>Thanks</p>