From f35568234278af6be1ee9e808b4c59ae4bceaa76 Mon Sep 17 00:00:00 2001 From: Max Hunt Date: Mon, 10 Feb 2020 17:30:47 +0000 Subject: [PATCH] Update --- main.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 8734a0d..6ae7439 100755 --- a/main.py +++ b/main.py @@ -353,9 +353,11 @@ def _tf_service_initializer(): def tf_service(init=True): if init: + print('Starting tf service thread') tf_service_thread = threading.Thread(target=_tf_service_initializer) tf_service_thread.start() else: + print('Killing tf service thread') tf_service_thread.kill() @@ -458,12 +460,12 @@ tf_service(init=True) try: - print('Done with task, waiting to kill tf service') + print('Done with task, enter x to kill tf service') while True: - time.sleep(0.1) -except KeyboardInterrupt: - print("KeyboardInterrupt has been caught., killing tf service") - tf_service(init=False) + a = raw_input() + if a == 'x' or x == 'X': + print("x has been caught, killing tf service") + tf_service(init=False) print("Done, exiting") exit(0)