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 306 views
1 answer 325 views
1 answer 319 views
1 answer 291 views
1 answer 260 views
...