Answers
貌似得在主线程里做...
18.5. signal — Set handlers for asynchronous events
...
18.5.1.2. Signals and threads
Python signal handlers are always executed in the main Python thread, even if the signal was received in another thread. This means that signals can’t be used as a means of inter-thread communication. You can use the synchronization primitives from the threading module instead.
Besides, only the main thread is allowed to set a new signal handler.
射得满满的
answered 10 years, 5 months ago