Answer the question
In order to leave comments, you need to log in
Python. How to solve the problem with the encoding of the CSV file output in the terminal?
Good afternoon, I started learning Python, got to CSV files and outputting their data to the terminal.
I ran into an encoding problem.
Plz tell me what to insert where so that there is no kryakozyabr?
System: Windows 10, Python 3.7.1, Visual Studio Code, cmder terminal as bash
Code:
exampleFile = open('example.csv')
exampleReader = csv.reader(exampleFile)
exampleData = list(exampleReader)
print(exampleData)
Answer the question
In order to leave comments, you need to log in
https://docs.python.org/3/library/csv.html#reader-...
import csv
with open('some.csv', newline='', encoding='utf-8') as f:
reader = csv.reader(f)
for row in reader:
print(row)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question