If you need all the words on different lines, you need to set the divisor to \n :
l = ['hello','how','are','you'] import csv with open("out.csv","w") as f: wr = csv.writer(f,delimiter="\n") wr.writerow(l)
Output:
hello how are you
If you want a comma comma:
with open("out.csv","w") as f: wr = csv.writer(f,delimiter="\n") for ele in l: wr.writerow([ele+","])
Output:
hello, how, are, you,
I would recommend just writing elements without a trailing comma, there is no advantage to having a trailing comma, but it can cause problems later.
Padraic cunningham
source share