From 731ae877e52716f29824b7da0efa2d6c0545c74c Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Wed, 24 Apr 2024 11:18:45 +0100 Subject: [PATCH] Save local files as csv. I suspect the original impetus for .txt was the ability to open in Thonny, but it's more useful to be explicit about the file format. --- enviro/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enviro/__init__.py b/enviro/__init__.py index f088ea5..f92753d 100644 --- a/enviro/__init__.py +++ b/enviro/__init__.py @@ -421,7 +421,7 @@ def get_sensor_readings(): def save_reading(readings): # open todays reading file and save readings helpers.mkdir_safe("readings") - readings_filename = f"readings/{helpers.date_string()}.txt" + readings_filename = f"readings/{helpers.date_string()}.csv" new_file = not helpers.file_exists(readings_filename) with open(readings_filename, "a") as f: if new_file: