le_simple_mot/generate_list.py

10 lines
220 B
Python

with open("data.csv", "r") as data:
mots = data.readlines()
liste = []
for mot in mots[:1000]:
liste.append(mot.split(",")[0])
with open("list.txt", "w+") as f:
f.write("[\"" + '\",\"'.join(liste) + "\"]")