Interview Questions

Why don't my signal handlers work?

Python Questions and Answers


(Continued from previous question...)

Why don't my signal handlers work?

The most common problem is that the signal handler is declared with the wrong argument list. It is called as

handler(signum, frame)

so it should be declared with two arguments:

def handler(signum, frame):
...

(Continued on next question...)

Other Interview Questions