thread.interrupt_main()

thread.interrupt_main()

Raise a KeyboardInterrupt in the main thread. A subthread can use this function to interrupt the main thread.