how to stop a loop with ESC key? [newbie]
fredrik at pythonware.com
Tue Nov 8 08:59:17 CET 2005
"mo" <WYWAL_TOmich202 at o2.pl> wrote:
> Can somebody explain how to stop a WHILE loop in running program by pressing
> ESC key?
depends on the platform.
on windows, you can use the mscvrt module:
if msvcrt.kbhit() and msvcrt.getch() == chr(27):
also see the second example on this page:
More information about the Python-list