if __name__ == '__main__':
    # Make it possible to exit application with ctrl+c on console
    signal.signal(signal.SIGINT, signal.SIG_DFL)

其中信号SIGINT由按下Ctrl-C发出

Get a signal -SIGINT //按下Ctrl-C得到的结果 

SIG_DFL:恢复参数signum所指信号的处理方法为默认值。