我正在尝试向CSVreader对象添加一个属性:
import csv
csvfile = open(inputfilepath, 'rb')
csv_reader = csv.reader(csvfile, delimiter=',', quotechar='"')
setattr(csv_reader, 'nrows', countRows(csvfile))
接收此错误:
AttributeError: '_csv.reader' object has no attribute 'nrows'
Tags:
目前没有回答
相关问题 更多 >
编程相关推荐