Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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
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: 556
    
    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
 
Similar Threads
Limiting time for user response
Wait in Java
Validation of database path, port number and ip address
Calculation displays scientific format instead of a whole number
How yo use JOptionPane.showInputDialog()