Python/System Signals

From Fundamental Ramen
< Python
Revision as of 09:21, 14 June 2018 by Tacoball (talk | contribs) (Created page with "<source lang="python3"> import signal def on_ctrl_c(signum, frame): exit(1) signal.signal(signal.SIGINT, on_ctrl_c) </source>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
import signal

def on_ctrl_c(signum, frame):
    exit(1)

signal.signal(signal.SIGINT, on_ctrl_c)