Skip to content

Instantly share code, notes, and snippets.

@mariusgrigaitis
Created October 23, 2015 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariusgrigaitis/b914c8303ce18d9660c7 to your computer and use it in GitHub Desktop.
Save mariusgrigaitis/b914c8303ce18d9660c7 to your computer and use it in GitHub Desktop.
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