From: Ole Artz Date: Mon, 11 Jul 2022 12:36:01 +0000 (+0200) Subject: live_telnet_data_plot: fix overwriting datafile X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=cce7aab20b0b9706e946b89f01b8756f32159dfa;p=avr.git live_telnet_data_plot: fix overwriting datafile --- 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()