Why doesn't Python include non-blocking keyboard input function?

Steve D'Aprano steve+python at pearwood.info
Fri Oct 28 20:32:08 EDT 2016


On Sat, 29 Oct 2016 02:28 am, BartC wrote:

>> By using the name of a Unix system call, one might think so.
> 
> Python is cross-platform, isn't it?

The os module isn't. It is specifically designed for OS-specific functions.

There's lots of OS-specific functionality in Python. In general, Python
won't make any promises that the OS doesn't, nor will it generally offer
any feature that the OS doesn't. In particular, system calls are only
available on platforms that provide that system call. (Duh.)

So no Windows system calls on Unix, and no Unix system calls on Windows.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list