it works fine without time, but i want to add time to it, when i added time, its dont writing my data, and its just file without any extensions like .csv
code:
# Write csv file
def write_csv(data: list) -> None:
# Date in YEAR-MONTH-DAY-HOUR:MINUTE format
t = datetime.now().strftime("%Y-%m-%d-%H:%M")
name = f"data_{t}.csv"
with open(name, "w", newline="", encoding="utf-8") as f:
w = csv.writer(f)
w.writerow(["PRICE", "OLD PRICE", "NAME", "LINK"])
# writing the data rows
w.writerows(data)