My experiment code is like:
import signal
def hi(signum, frame):
print "hi"
signal.signal(signal.SIGINT, hi)
signal.signal(signal.SIGINT, signal.SIG_IGN)
hi didn't get printed, because the signal handler is overridden by signal.SIG_IGN.
How can I avoid this?