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:


file1=open('myfile.csv','w')
writer=csv.writer(file1)

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

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


file1.close()


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!

Judith


      
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to