[Tutor] Writing long strings (that include commas) to a csv file

Judith Flores juryef at yahoo.com
Thu Jan 22 20:33:20 CET 2009

Hello dear Python experts,

How can I write a complete string (which sometimes will include many commas) to a cell in a CSV file? With the code below, what I obtain is a cell per letter of every string:


mylist=[ " first , txt+words , more" , " second, text + words, and more"]

for i in range(0,len(mylist)):
            writer.writerow(mylist[i] + listnumbers[i])


So the first element of mylist should fill up only one cell in the csv file, and the same for the second elemente, and so on.

Any help would be very much appreciated.

Thank you!



More information about the Tutor mailing list