python signal management

 

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

Wherein the signal emitted by the SIGINT press Ctrl-C

Get a signal -SIGINT // press Ctrl-C Results obtained 

SIG_DFL: recovery parameters referred signum signal processing method to a default value. 

Guess you like

Origin www.cnblogs.com/yibeimingyue/p/11247348.html