how to stop a loop with ESC key? [newbie]

2005-11-07 Thread mo
Can somebody explain how to stop a WHILE loop in running program by pressing
ESC key?
mo


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to stop a loop with ESC key? [newbie]

2005-11-08 Thread mo
Thanks,
I tryed your example:

import msvcrt
while 1:
print '.'
if msvcrt.kbhit() and msvcrt.getch() == chr(27):
 break

but it doesn't work. It is running (Win2000), there is no messages about
errors but there is no effect when pressing ESC key. What I am doing wrong?
mo


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to stop a loop with ESC key? [newbie]

2005-11-08 Thread mo
"Fredrik Lundh"  wrote:
> works for me, when running it from a stock CPython interpreter in a
windows
> console window, with focus set to that window.
> what environment are you using?

I use IDLE 1.0.3, Python 2.3.4
The same problem is when running in a win console.
mo


-- 
http://mail.python.org/mailman/listinfo/python-list