def _ctrl_handler(sig):
 if (sig == signal.CTRL_C_EVENT):
  pass
 elif (sig == signal.CTRL_BREAK_EVENT):
  pass
 else:
  print 'UNKNOWN EVENT'
 return 0

def _ctrl_handler ( sig ) : if ( sig == signal . CTRL_C_EVENT ) : pass elif ( sig == signal . CTRL_BREAK_EVENT ) : pass else : print 'UNKNOWN EVENT' return 0
handle a sig event and return 0 to terminate the process .