Thanks for the replies.
On May 8, 5:50*pm, Jean-Paul Calderone <exar...@divmod.comwrote:
Ctrl+C often works with Python, but as with any language, it's possibleYes, thank you, this seems to work. :)
to write a program which will not respond to it. *You can use Ctrl+\
instead (Ctrl+C sends SIGINT which can be masked or otherwise ignored,
Ctrl+\ sends SIGQUIT which typically isn't)
I did some more testing and found out that the problem seems to be
thread-related. If I have a single-threaded program, then Ctrl+C
usually works, but if I have threads, it is usually ignored. For
instance, the below program does not respond to Ctrl+C (but it does
die when issued Ctrl+\):
import threading
def loop():
while True:
pass
threading.Thread(target=loop,args=()).start()