我究竟做错了什么 ?
我只需要在 Control+C 上杀死两个线程。
def cleanup_stop_thread():
for thread in enumerate():
if thread.isAlive():
try:
self._Thread__stop()
except:
print(str(thread.getName()) + ' could not be terminated')
if __name__ == '__main__':
try:
threading.Thread(target = record).start()
threading.Thread(target = ftp).start()
except (KeyboardInterrupt, SystemExit):
cleanup_stop_thread();
sys.exit()