msvcrt.getch() from IDLE returns '\377'

Georg Simon georg.simon at bnmsp.de
Wed Sep 27 07:54:17 EDT 2000


Windows 98
sys.version '1.6 (#0, Sep  5 2000, 08:16:13) [MSC 32 bit (Intel)]'

It seems to me that msvcrt.getch() does not work when called from IDLE.


My testfile LK.Py

import msvcrt
Taste = msvcrt.getch()
while Taste == '\377' :
    print ord(Taste),
    Taste = msvcrt.getch()
print ord(Taste)


In IDLE I type execfile('LK.Py') and get an endless loop printing 255
coloured blue.
When I press a character key I can see this character echoed directly to
the console coloured black.
Is there a way out ?

Georg




More information about the Python-list mailing list