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
  • 10,958
  • 8
  • 49
  • 51

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
  • 132,101
  • 31
  • 237
  • 267