Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

readLine() blocking  RSS feed

 
Jessid Leon Velez Gutierrez
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I am trying to write some code to make method readLine() to wait only for few seconds, and if after a time a '\n' or 'r' character does not arrive, just stop waiting.

Is there any possible way to do that?
Thanks a lot
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends what you are reading from. For example, sockets can be configured to time out after a period of time. Reading from the console, on the other hand, cannot be interrupted.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!