Last active
December 3, 2015 05:53
-
-
Save kindlyfire/0d1b65c55e3fbaf8f7c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import signal | |
import sys | |
def signal_handler(signal, frame): | |
# Faites vos sauvegardes ici | |
print('You pressed Ctrl+C!') | |
sys.exit(0) | |
signal.signal(signal.SIGINT, signal_handler) | |
print('Press Ctrl+C') | |
signal.pause() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment