Why doesn't Python include non-blocking keyboard input function?
Paul Rubin
no.email at nospam.invalid
Tue Oct 25 12:32:29 EDT 2016
More information about the Python-list mailing list
Tue Oct 25 12:32:29 EDT 2016
- Previous message (by thread): Why doesn't Python include non-blocking keyboard input function?
- Next message (by thread): Why doesn't Python include non-blocking keyboard input function?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
jladasky at itu.edu writes: > ... I find myself asking why Python doesn't include a standard, > non-blocking keyboard input function. I have often wanted one myself. I agree this would be useful. Forth has a standard word KEY to read a key, and I used it in a simple game that I wrote a few months ago (you enter a key indicating which way you want to move). > The only way that I've ever achieved this behavior is: ... In *nix you should be able to set the tty modes with fcntl.ioctl so that reading from stdin returns immediately when you hit a key. You should be able to use select.select with zero timeout to see whether input is available.
- Previous message (by thread): Why doesn't Python include non-blocking keyboard input function?
- Next message (by thread): Why doesn't Python include non-blocking keyboard input function?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list