[Tutor] Python 3.0

Alan Gauld alan.gauld at btinternet.com
Sat Feb 20 16:57:55 CET 2010


"bob gailer" <bgailer at gmail.com> wrote
>>     k = msvcrt.getch()     # Strangely, this echoes to the IDLE window
>>     if k == ' ':           # Not recognized

> IOW - getch always returns 1 character.
> 
> You are testing for a 0 length string. Will never happen.

No, he is testing for a space character.
But he is running it in IDLE and msvcrt only works n the 
OS command window world.

I've updated my tutorial page to point that out.


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list