Python - get key pressing ?

Krisztian Kepes Kepes.Krisztian at peto.hu
Thu Jul 3 09:36:56 CEST 2003


Hi !

I want to create an py program what process datas for long time.
But: I want to abort it if I need.
Not with Ctrl+Break !

If I push a key (B, or other), the script must stop his work, and save the result created before.

What I need to catch the keyboard events - without stopping a script ?

Example:

while False:
 DoWorkPeriodic()
 if KeyEvent=='B':
   SaveWork
   Stopit

KK









More information about the Python-list mailing list