From 5c715695457f6515a1f1d42efd0eadd839acff36 Mon Sep 17 00:00:00 2001 From: Nick Renieris Date: Wed, 22 Jun 2022 20:11:01 +0300 Subject: [PATCH] tcpServer: Don't print intermittent newlines --- scripts/tcpServer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tcpServer.py b/scripts/tcpServer.py index 5f2c7b5..8ed2453 100644 --- a/scripts/tcpServer.py +++ b/scripts/tcpServer.py @@ -23,11 +23,11 @@ while True: while True: data = connection.recv(1024) if data: - print(data.decode("utf-8")) + print(data.decode("utf-8"), end='', flush=True) else: print(f'Connection Terminated.') break - + finally: # Clean up the connection connection.close() \ No newline at end of file