Jak przechwycić SIGINT w Pythonie w systemie Windows?

(Podobny doto pytanie)

W systemie UNIX w Pythonie 2.7 w wierszu polecenia Python:

 >>> import signal
 >>> def handler(signal, frame):
 ...     print 'welcome to the handler'
 ...
 >>> signal.signal(signal.SIGINT, handler)
 <built-in function default_int_handler>

Wciskam ctrl-c

 >>> welcome to the handler

 >>>

W systemie Windows:

 >>> import signal
 >>> def handler(signal, frame):
 ...     print 'welcome to the handler'
 ...
 >>> signal.signal(signal.SIGINT, handler)
 <built-in function default_int_handler>

Po naciśnięciu ctrl-c:

 >>>
 KeyboardInterrupt
 >>>

Mogę to zweryfikowaćhandler jest instalowany po stronie Pythona jako program obsługi SIGINT (wywoływaniesignal.signal drugi zegar zwraca mójhandler). Jak mogę przechwycić SIGINT w systemie Windows?

questionAnswers(1)

yourAnswerToTheQuestion