39votes
1answer
2083views
How to handle keyboard interrupts in Python
My script should clean up when user presses Ctrl+C. How do I handle this?