From cce7aab20b0b9706e946b89f01b8756f32159dfa Mon Sep 17 00:00:00 2001 From: Ole Artz Date: Mon, 11 Jul 2022 14:36:01 +0200 Subject: [PATCH] live_telnet_data_plot: fix overwriting datafile --- .../EthernetUART/LANTelnetToI2C_Board/live_telnet_data_plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/EthernetUART/LANTelnetToI2C_Board/live_telnet_data_plot.py b/esp32/EthernetUART/LANTelnetToI2C_Board/live_telnet_data_plot.py index af56229..6b7802d 100644 --- a/esp32/EthernetUART/LANTelnetToI2C_Board/live_telnet_data_plot.py +++ b/esp32/EthernetUART/LANTelnetToI2C_Board/live_telnet_data_plot.py @@ -102,7 +102,7 @@ def get_data(): file.write('\n' + timestamp.strftime('%Y-%m-%d %H:%M:%S.%f') + '\n' + str(reader)) # file.write(file_history + '\n' + timestamp + '\n' + ch0 + '\n' + ch1 + '\n' + ch2 + '\n' + ch3 + '\n') except: - with open(filename, "w") as file: + with open(filename, "a") as file: file.write(timestamp.strftime('%Y-%m-%d %H:%M:%S.%f') + '\n' + str(reader)) # file.write(timestamp + '\n' + ch0 + '\n' + ch1 + '\n' + ch2 + '\n' + ch3 + '\n') file.close() -- 2.43.0