[Tutor] need help with msvcrt.getch()

Alan Gauld alan.gauld at btinternet.com
Tue Jul 27 18:09:32 CEST 2010


"Richard D. Moores" <rdmoores at gmail.com> wrote

> Please see <http://tutoree7.pastebin.com/f3TaxDBc>.
>
> I'm trying to recall what I used to know, thus this simple script. 
> But 'y'
> or 'q' do nothing. What's wrong?

I don't think you need kbhit() or the sleep(.1)
The if kbhit test will only pass if the key is actually hit at that 
time.
Often it won't be so you will miss it.

I think getch() will wait for a key to be hit.

But thats from memory and I'm too busy to try it out right now.

Alan G. 




More information about the Tutor mailing list