IDLE and msvcrt getch()

R

Ron Adam

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top