Created
October 23, 2015 12:09
-
-
Save mariusgrigaitis/b914c8303ce18d9660c7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import signal | |
def intHandler(signum, frame): | |
print "user pressed ctrl-c" | |
raise KeyboardInterrupt() | |
# Set the signal handler | |
signal.signal(signal.SIGINT, intHandler) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment