everyone.I have a list of lists and I want to write them in a csv file with columns and rows.I have tried the writerows but it isn\'t what I want.An example of my list is th
The provided examples, using csv modules, are great! Besides, you can always simply write to a text file using formatted strings, like the following tentative example:
l = [[1, 2], [2, 3], [4, 5]]
out = open('out.csv', 'w')
for row in l:
for column in row:
out.write('%d;' % column)
out.write('\n')
out.close()
I used ; as separator, because it works best with Excell (one of your requirements).
Hope it helps!