Re: [Tutor] Python 3.0

2010-02-20 Thread Mark Tolonen
"bob gailer" wrote in message news:4b7fea0e.6000...@gmail.com... On 2/20/2010 5:52 AM, Paul Whittaker wrote: Using the following script, the (Windows 7) PC echoes the key presses but doesn't quit (ever!) import msvcrt print('Press SPACE to stop...') while True: k = msvcrt.getch()

Re: [Tutor] Python 3.0

2010-02-20 Thread Alan Gauld
"bob gailer" 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 runnin

Re: [Tutor] Python 3.0

2010-02-20 Thread Alan Gauld
"Paul Whittaker" wrote Using the following script, the (Windows 7) PC echoes the key presses but doesn't quit (ever!) import msvcrt print('Press SPACE to stop...') while True: k = msvcrt.getch() # Strangely, this echoes to the IDLE window You will need to run it in an OS command wind

Re: [Tutor] Python 3.0

2010-02-20 Thread bob gailer
On 2/20/2010 5:52 AM, Paul Whittaker wrote: Using the following script, the (Windows 7) PC echoes the key presses but doesn't quit (ever!) import msvcrt print('Press SPACE to stop...') while True: k = msvcrt.getch() # Strangely, this echoes to the IDLE window if k == ' ':

[Tutor] Python 3.0

2010-02-20 Thread Paul Whittaker
Using the following script, the (Windows 7) PC echoes the key presses but doesn't quit (ever!) import msvcrt print('Press SPACE to stop...') while True: k = msvcrt.getch() # Strangely, this echoes to the IDLE window if k == ' ': # Not recognized break _