#读csv文件
import csv
'''
path=r'I:\1.csv'
readCsv(path)
def readCsv(path):
infoList=[]
with open(path,'r')as f:
allFileInfo=csv.reader(f) #读出是个对象
for row in allFileInfo: #运用for语句一行一行的拿
infoList.append(row) #每一行是一个列表
return infoList
'''
#写csv文件
path=r'I:\1.csv'
def writeCsv(path,data):
with open(path,'w') as f:
writer=csv.writer(f)
for rowData in data:
writer.writerow(rowData)
writeCsv(path,[[1,2,3],[4,5,6]]) #传入分data 是个一列表为元素的列表