Python 读写excel数据

读取excel 文件的数据

import csv
with open('D:/mystuff/11.csv','r') as f:
reader = csv.reader(f)
for row in reader:
print(row)

写入excel文件

import csv
with open('D:/mystuff/33.csv', mode='w') as csvfile:
#w1=csv.writer(csvfile,delimiter=' ',quotechar="|",quoting=csv.QUOTE_MINIMAL)
w1=csv.writer(csvfile,dialect='excel')
w1.writerow(['','','',''])
w1.writerow(['','','',''])
w1.writerow(["chenfenping","","",""])
w1.writerow(["cx"])
上一篇:自学Java之day07_Java类Random


下一篇:shell编程(四)之循环控制语句(for,while,until,break,continue,case)