for example, there's a code like this:
import signal
import time
def handler(signum, frame):
print( 'Ctrl+C not allowed')
signal.signal(signal.SIGINT, handler)
for i in range(100):
a = input("please input a number:")
if i == a:
print(i)
else:
print(a)
print("Finished")
All above codes works fine when running it in Python IDLE even mistakenly "Ctrl+C" are pressed.
The problem is that when running this xx.py file by double clicking it, it shows it is running by py.ext on the window. When I press down "Ctrl+C", the running window disappears right away.(I run it windows 11 system.)
Is there a method to solve this problem please? Many thanks.