signal

The signal module is used to write signal handlers in Python. Signals usually correspond to asynchronous events that are sent to a program due to the expiration of a timer, arrival of incoming data, or some action performed by a user. The signal interface emulates that of UNIX, although parts of the module are supported on other platforms.

alarm(time)

If time is nonzero, a SIGALRM signal is scheduled to be sent to the program in time seconds. Any previously scheduled alarm is canceled. If time is zero, no alarm is scheduled and any previously set alarm is canceled. Returns the number of seconds remaining before any previously scheduled alarm, or zero if no alarm was scheduled (UNIX).

getsignal(signalnum)

Returns the signal handler for ...

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.