4

Possible Duplicate:
raw_input and timeout

raw_input() will wait for user input. How to make it go after waiting a few seconds?

Community
  • 1
  • 1
Andrew_1510
  • 12,258
  • 9
  • 51
  • 52

1 Answers1

3

One potential option:

import select, sys
r, w, x = select.select([sys.stdin], [], [], 3)

This will block for ~3 seconds - any data present will be in r after.

Jon Clements
  • 138,671
  • 33
  • 247
  • 280