I have a method that export to csv. and I have a list with default values. The problem is that the default values go into one column, and I want them to go into a single row.
list = ['test1', 'test2, 'test3']
I have a method that export to csv. and I have a list with default values. The problem is that the default values go into one column, and I want them to go into a single row.
list = ['test1', 'test2, 'test3']
import csv
l = ['test1', 'test2', 'test3']
with open('eggs.csv', 'wb', newline='') as csvfile:
spamwriter = csv.writer(csvfile, delimiter=',',
quotechar='|', quoting=csv.QUOTE_MINIMAL)
spamwriter.writerow(l)
You'd better not use list as a variable name, since it collides with python's internal list function.