How write a string with commas to a spreadsheet file (CSV) in Python

1 Answer

0 votes
import csv

csv = open('d:\data.csv', "w")

s = "abcd, efg, hij"
s = "\"" + s + "\""

csv.write(s)

'''
run:

data.csv
--------
abcd, efg, hij

'''

 



answered Jun 29, 2018 by avibootz

Related questions

1 answer 215 views
1 answer 231 views
1 answer 236 views
1 answer 191 views
1 answer 181 views
...