blocking read on stdin on Windows?

Jeff Learman jlearman at cisco.com
Sun Sep 5 04:10:54 CEST 2004


Aha. It works for me too, if I run from DOS prompt.
It's only failing when I run from IDLE Python Development Environment.
I'll file a bug report.

Thanks for your help!  I'd be happy to help you out in return;
just let me know if you want some piano or Hammond organ tracks
for original recordings ;)

Jeff

Dennis Lee Bieber wrote:

> On Sat, 04 Sep 2004 16:35:00 -0400, Jeff Learman <jlearman at cisco.com>
> declaimed the following in comp.lang.python:
> 
> 
> 
>>Any ideas?
>>
> 
> 	Seems to work here (W98SE, "MS-DOS PROMPT" window)...
> 
> G:\>type t.py
> import msvcrt
> 
> print msvcrt.kbhit()
> print "prompt: ",
> ch = msvcrt.getche()
> print
> print ord(ch)
> 
> G:\>python t.py
> 0
> prompt: a
> 97
> 
> G:\>python t.py
> 0
> prompt:
> 0
> 
> 
> 	Note -- the second one was <ctrl-@>; IOW, a "null" byte.
> 
> G:\>type t.py
> import msvcrt
> 
> print msvcrt.kbhit()
> print "prompt: ",
> ch = msvcrt.getche()
> print
> print `ch`
> 
> 
> G:\>python t.py
> 0
> prompt:
> '\x00'
> 




More information about the Python-list mailing list