From 1239ed09c8e7f8a1f8903e18cb3972418a977796 Mon Sep 17 00:00:00 2001 From: tkb-github <130416721+tkb-github@users.noreply.github.com> Date: Wed, 3 Jul 2024 10:38:16 +0800 Subject: [PATCH] Update csv_tools.py --- csv_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csv_tools.py b/csv_tools.py index 2084c4de..49576a84 100644 --- a/csv_tools.py +++ b/csv_tools.py @@ -48,7 +48,7 @@ def sort_lat(file="latin.csv", column="Ref."): # fieldnames are the first row of the csv file so don't need to be provided sorted_conj = sorted(conjj, key=lambda row: human_sort_dict(row, column)) # old key=lambda row: row[column] try: - with open(file, "w", encoding="utf8", newline="") as conj_csv: + with open(file, "w", encoding="utf8", newline="\n") as conj_csv: writer = csv.DictWriter(conj_csv, fieldnames) writer.writeheader() writer.writerows(sorted_conj)