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

Gregory Ewing greg.ewing at canterbury.ac.nz
Thu Oct 27 17:51:16 EDT 2016


BartC wrote:
> "There's a room in your house with no door to it; how do I get in?"
> 
> "There's no need for a door because no one ever uses that room! But you 
> can get in through the chimney - if you /have/ to."

It's not like that. The room *does* have a door, it's just
that it's in different places in different houses, and may
require a different key to open it.

> function peek(p,t=byte)=
>     return makeref(p,t)^
> end

You can achieve similar things in Python using ctypes if
you really need to live that dangerously.

-- 
Greg



More information about the Python-list mailing list