Answer the question
In order to leave comments, you need to log in
How to fix encoding error when reading cvs file?
I want to read a file in a loop in python 3:
f = open(name, 'r')
for i in f:
print(i)
Answer the question
In order to leave comments, you need to log in
https://docs.python.org/3.1/library/csv.html
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