Python - get key pressing ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Krisztian Kepes

    Python - get key pressing ?

    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





Working...