G
G
GGatsby2018-03-05 13:24:46
Python
GGatsby, 2018-03-05 13:24:46

How to create csv?

How to create a new csv with separated columns?
example:
A. b.
name . age.
name . age.
name . age.
name . age.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2018-03-05
@GGatsby

So, what?

>>> import csv
>>> with open('ex.csv', 'w', newline='') as csvfile:
...    spamwriter = csv.writer(csvfile, delimiter='.', quotechar='', quoting=csv.QUOTE_NONE)
...    spamwriter.writerow(['A', 'B'])
...    spamwriter.writerow(['test', 10])

$ cat ex.csv 
A.B
test.10

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question