I\'m working on a python script that starts several processes and database connections. Every now and then I want to kill the script with a Ctrl+C sign
From Python's documentation:
import signal import time def handler(signum, frame): print 'Here you go' signal.signal(signal.SIGINT, handler) time.sleep(10) # Press Ctrl+c here