signal.alarm replacement in Windows [Python]

The most robust solution is to use a subprocess, then kill that subprocess. Python2.6 adds .kill() to subprocess.Popen().

I don’t think your threading approach works as you expect. Deleting your reference to the Thread object won’t kill the thread. Instead, you’d need to set an attribute that the thread checks once it wakes up.

Leave a Comment