From 121b70c77dc393789ebf3e8186b2067beb84b33c Mon Sep 17 00:00:00 2001 From: jonnybravo Date: Mon, 20 Oct 2025 13:55:00 +0200 Subject: [PATCH] tyr --- files/modify_csv.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/files/modify_csv.py b/files/modify_csv.py index d9ee045..3e1d837 100755 --- a/files/modify_csv.py +++ b/files/modify_csv.py @@ -3,8 +3,18 @@ import csv import os from datetime import date +from datetime import datetime -default_csv = "ausgaben_month/ausgaben.csv" + +def check_csv_file_create_new(): + current_month = datetime.now().month + current_year = datetime.now().year + csv_file = str(current_year) + "-" + \ + str(current_month) + "-" + "ausgaben.csv" + return str(csv_file) + + +default_csv = "ausgaben_month/" + check_csv_file_create_new() def create_csv_file(csv_path=default_csv): @@ -57,6 +67,7 @@ def sum_all(): if __name__ == "__main__": + default_csv = "ausgaben_month/ausgaben.csv" print(sum_all()) # Apply multiple filters # print(create_csv_file())