signal name description sigttou sigurg sigusr sigusr control tty urgent condition user defined user defined virtual time alarm window size change cpu limit exceeded file size limit exceeded sigvtalrm sigwinch sigxcpu sigxfsz in additionthe module defines the following variablesvariable description sig_dfl sig_ign nsig signal handler that invokes the default signal handler signal handler that ignores signal one more than the highest signal number example the following example illustrates timeout on establishing network connection (the socket module already provides timeout option so this example is merely meant to illustrate the basic concept of using the signal moduleimport signalsocket def handler(signumframe)print 'timeout!raise ioerror'host not responding sock socket socket(socket af_inetsocket sock_streamsignal signal(signal sigalrmhandlersignal alarm( -second alarm sock connect('www python org' connect signal alarm( clear alarm notes signal handlers remain installed until explicitly resetwith the exception of sigchld (whose behavior is implementation-specificn it' not possible to temporarily disable signals signals are only handled between the atomic instructions of the python interpreter the delivery of signal can be delayed by long-running calculations written in (as might be performed in an extension modulen if signal occurs during an / operationthe / operation may fail with an exception in this casethe errno value is set to errno eintr to indicate an interrupted system call certain signals such as sigsegv cannot be handled from python python installs small number of signal handlers by default sigpipe is ignoredsigint is translated into keyboardinterrupt exceptionand sigterm is caught in order to perform cleanup and invoke sys exitfunc lib fl ff