• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to wait for input read a number of seconds

 
Stelian Galmati
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Does anybody knows how to make a python script wait for input for a number of seconds and if nothing is entered go to next line.

If I use sys.stdin.readline(), I want to wait for input 5 seconds and nothing is entered just skip with a default value.

Thanks
 
Steve Fahlbusch
Bartender
Posts: 602
7
Mac OS X Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
look at the select package.

in specific select.select( )

that is: select.select that should take care of you
 
Stelian Galmati
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found it in the meantime. Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic