D
D
Dmitry2017-10-24 18:03:23
Python
Dmitry, 2017-10-24 18:03:23

Why does Windows save the csv file crookedly?

I save the file under Linux and get a normal file:
59ef55aec819b366511401.png
If the same script is run under windows, then for different organizations the addresses begin to repeat
59ef55ea49b43232549830.png
The save code itself:

def save_data(row, file_name):
    with open(file_name, 'a', newline='') as f:
        writer = csv.writer(f)
        if row:
            writer.writerow(row)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
artem78, 2017-10-24
@artem78

Specify UTF-8 encoding when opening a file in Windows.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question