Equivalent of thread.interrupt_main() in Python 3
问题 In Python 2 there is a function thread.interrupt_main() , which raises a KeyboardInterrupt exception in the main thread when called from a subthread. This is also available through _thread.interrupt_main() in Python 3, but it's a low-level "support module", mostly for use within other standard modules. What is the modern way of doing this in Python 3, presumably through the threading module, if there is one? 回答1: Well raising an exception manually is kinda low-level, so if you think you have