IDLE and msvcrt getch()

Ron Adam radam2 at tampabay.rr.com
Sun Oct 26 02:54:08 EST 2003



Yes, another newbie question.  :-)

When I run the following from idle, the msvcrt.getch() function always
returns 255 and it doesn't wait for a key press.  It also displays the
key on the screen when it should not. 


import msvcrt

while 1:
    k = msvcrt.getch()
    print k
    if k == 'q':
        break


If i run it from a standard console window it works fine.   Is this
normal in that it works this way for everyone?

It seems like idle's keyboard routines are getting in the way.  Any
way around this?








More information about the Python-list mailing list