aspose file tools*
The moose likes Jython/Python and the fly likes How to wait for input read a number of seconds Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Languages » Jython/Python
Bookmark "How to wait for input read a number of seconds" Watch "How to wait for input read a number of seconds" New topic
Author

How to wait for input read a number of seconds

Stelian Galmati
Greenhorn

Joined: Aug 12, 2010
Posts: 3
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

Joined: Sep 18, 2000
Posts: 570
    
    7

look at the select package.

in specific select.select( )

that is: select.select that should take care of you
Stelian Galmati
Greenhorn

Joined: Aug 12, 2010
Posts: 3
Found it in the meantime. Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to wait for input read a number of seconds