Created
February 22, 2019 09:09
-
-
Save kingardor/f5ecd5d3eac3824ca1acd7d95c4816e5 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): | |
# Perform your actions here | |
print('Ctrl+c occured') | |
signal.signal(signal.SIGINT, signal_handler) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment