私は何を間違っていますか?
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()