import csv #打开文件,用with打开可以不用去特意关闭file了,python3不支持file()打开文件,只能用open() with open("info.csv","r") as csvfile: #读取csv文件,返回的是迭代类型 read = csv.reader(csvfile) for i in read: print(i)
import csv #打开文件,用with打开可以不用去特意关闭file了,python3不支持file()打开文件,只能用open() with open("info.csv","r") as csvfile: #读取csv文件,返回的是迭代类型 read = csv.reader(csvfile) for i in read: print(i)