Skip to content

Instantly share code, notes, and snippets.

@povilasb
Created June 23, 2016 16:51
Show Gist options
  • Save povilasb/c687fc7613ff4dad882cc299aee29e7f to your computer and use it in GitHub Desktop.
Save povilasb/c687fc7613ff4dad882cc299aee29e7f to your computer and use it in GitHub Desktop.
Unix signal handling in python
import signal
def handler(signum, frame):
print("SIGHUP")
signal.signal(signal.SIGHUP, handler)
print("Press enter to finish")
input()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment