« Snow Leopard Guest User data loss bug | Main | A Dog's Consciousness »

October 17, 2009



typo error: nonBockingRawInput x nonBlockingRawInput

I also think that signal.alarm(0) is wrong. I needed to comment it in order to make it work.

Gary Robinson

Thanks for pointing out the typo in the function name.

But I don't know what to make of your comment about alarm(0). That's there to cancel the alarm once you've typed something in. It works under the Python versions I've tried. (Though note: as my post says at the top, this is only for unix-like OS's.)

See the example in the Python docs at the end of this page: http://docs.python.org/library/signal.html.

Anyone else have any experiences, pro-or-con, on that issue?

Also, if anyone has a version that works for Windows, I'd appreciate hearing about it!


Thats' really good stuff.

I have been searching for this for a while. Other recivpies, like http://code.activestate.com/recipes/134892/ are far more ugly!


Python for beginners

Thanks, this code has come in handy for me several times!! Too bad it's not cross-platform...

Hellmut Weber

Thanks for this post.
I use it now in a script where this problem bothered me for a long time.
Works on my debian 11 system with Python2.7 and Python 3.9, glad to have found it.

Best regards

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)