From 2bc0064083c9b991b502b971bf415691f9cbc334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Fri, 12 Aug 2022 02:18:26 +0200 Subject: [PATCH] added KeyboardInterrupt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- pc-client/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pc-client/main.py b/pc-client/main.py index a71290d..9ac30d1 100644 --- a/pc-client/main.py +++ b/pc-client/main.py @@ -14,5 +14,8 @@ except ImportError: host = serial.Serial('COM3', 9600) while True: - output = host.readline() - print(output.decode("ASCII")) \ No newline at end of file + try: + output = host.readline() + print(output.decode("ASCII")) + except KeyboardInterrupt: + break \ No newline at end of file