python csv

#coding:utf-8
import csv
data=[["w","a",1],
["l","o",2],
["z","h",3]]
file_name="data/meinian.csv"

fd=open(file_name,"w+",newline='')
writer=csv.writer(fd)
for dd in data:
# print(dd)
writer.writerow(dd)
fd.close()

fd =open(file_name,'r',newline='')
read=csv.reader(fd)
for d in read:
print(d)
print(d)
阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页