I want to customize a signal handler on windows, and then use os.kill in other processes to notify the signal to execute the corresponding handler. But the result is that the signal still executes the default handler.
I wrote the following test code, the same code, in the window, did not print anything. In Linux, 'hi' is printed.
import os
import signal
def sigint(*args):
print('hi')
signal.signal(signal.SIGINT , sigint)
os.kill(os.getpid(), signal.SIGINT)
Why lead to such different results?