def ctrl_c(signum, frame):
 SHUTDOWN_EVENT.set()
 print_('\nCancelling...')
 sys.exit(0)

def ctrl_c ( signum , frame ) : SHUTDOWN_EVENT . set ( ) print_ ( '\nCancelling...' ) sys . exit ( 0 )
catch ctrl-c key sequence and set a shutdown_event for our threaded operations .