"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()
"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
"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
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 == ' ':
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
_