Looks like signaling functionality under Windows is extremely limited. None of the alarm functions are available. <br><br>This script redefines SIGINT (ctrl-C keyboard interrupt under windows) and keeps looping.<br><br><div style="margin-left: 40px;">
import signal, os, time<br><br>def handler(signum, frame):<br> print 'You raised a SigInt! Signal handler called with signal', signum<br> #print 'Quitting now.'<br> #os.abort();<br> <br>signal.signal(signal.SIGINT, handler)<br>
<br>while True:<br> print 'Loop in...'<br> time.sleep(1)<br> print '3'<br> time.sleep(1)<br> print '2'<br> time.sleep(1)<br> print '1'<br> time.sleep(1)<br></div><br>
To trigger it, run the script under Windows, and then hit ctrl-c to raise the signal.<br><br>Here's the definitive doc I found that lists what's available where: <a href="http://docs.python.org/library/signal.html">http://docs.python.org/library/signal.html</a><br>
<br>-r<br><br><br>