jlada...@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. -- https://mail.python.org/mailman/listinfo/python-list