【发布时间】:2014-03-02 19:08:17
【问题描述】:
在我的 csv 程序开始时:
import csv # imports the csv module
import sys # imports the sys module
f = open('Address Book.csv', 'rb') # opens the csv file
try:
reader = csv.reader(f) # creates the reader object
for row in reader: # iterates the rows of the file in orders
print (row) # prints each row
finally:
f.close() # closing
错误是:
for row in reader: # iterates the rows of the file in orders
_csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
【问题讨论】: