Python3 -- CSV读取文件
作者:互联网
直接上代码:
# coding: utf-8 import csv csvfile = file('csv_test.csv', 'rb') reader = csv.reader(csvfile) for line in reader: print line csvfile.close()
import csv with open(filepath, 'r', encoding='utf8') as f: reader = csv.reader(f) for item in reader:
# item 每行的数据(列表格式[1, 2, 3, 4]) print(item)
标签:csv,读取,csvfile,item,reader,print,import,CSV,Python3 来源: https://www.cnblogs.com/gengyufei/p/12771938.html