首页 > 编程语言 > 详细

python将列表按行写入csv

时间:2020-05-14 13:53:34      阅读:479      评论:0      收藏:0      [点我收藏+]
import csv

rows2 = [‘abc1/ab1c‘,‘N‘]
for n in range(10):
    f = open("ok.csv", ‘a‘,newline=‘‘)
    writer = csv.writer(f)
    writer.writerow(rows2)
    f.close()

  

python将列表按行写入csv

原文:https://www.cnblogs.com/niulang/p/12888015.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!