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())