From 9ff7ac13e07c726f6dc319845dd47a58d5409975 Mon Sep 17 00:00:00 2001 From: Philipp Kramer Date: Tue, 31 May 2022 15:34:27 +0200 Subject: [PATCH] receive last data --- tests/socketreceivetest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/socketreceivetest.py b/tests/socketreceivetest.py index afe9210..9ead2da 100644 --- a/tests/socketreceivetest.py +++ b/tests/socketreceivetest.py @@ -21,9 +21,11 @@ while True: try: data = client.recv( 1024 ).decode( 'utf-8' ) if data: - splitdata=data.split(",") + lastdata=data.split('\n') + splitdata=lastdata[-2].split(",") + print("lastdata="+str(lastdata)) - print("Received :", repr(data)) + #print("Received :", repr(data)) print(splitdata) except socket.error: pass