M
M
maximka122017-04-24 13:48:17
Python
maximka12, 2017-04-24 13:48:17

How to correctly write a list to a csv file?

I write the list to the file "list.csv" but the whole list is written to the first cell. How can I make sure that each element of the list is written in a separate cell?

s = [1.0, 4.0, '10.04.2017 0:16:32', '7772CY01']
with open("список.csv", newline='') as file:
            csv.writer(file).writerow(s)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gill-sama, 2017-04-24
@maximka12

Look here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question