O
O
Oli2021-05-29 09:56:11
Python
Oli, 2021-05-29 09:56:11

How to write to csv on a new line?

Hello! I am writing a string to csv. Here's what happens

13,2да,3нет,4впредкушение,53,654,7русский,13,2да,3нет,4влюбленность,50,62,7русский


But I want it to start on a new line

13,2да,3нет,4впредкушение,53,654,7русский
13,2да,3нет,4влюбленность,50,62,7русский


My code:
with open('document.csv', 'a', newline='') as fd:
        fd.write(out)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yupiter7575, 2021-05-29
@irina222222

Add \n where you want it to wrap

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question