PyDocs

Nav

Concurrent Execution

interrupt_main

_thread

function
  • interrupt_main(signum=signal.SIGINT, /)
Simulate the arrival of the given signal in the main thread,
where the corresponding signal handler will be executed.
If *signum* is omitted, SIGINT is assumed.
A subthread can use this function to interrupt the main thread.

Note: the default signal handler for SIGINT raises ``KeyboardInterrupt``.
Changed in 3.10
  • 3.10: The signum argument is added to customize the signal number.
0 Examples
No examples for _thread/interrupt_main.
See Also
No see-alsos for _thread/interrupt_main
0 Notes
No notes for interrupt_main