python将列表按行写入csv

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()

  

posted @ 2020-05-14 13:17  牛郎  阅读(11358)  评论(0编辑  收藏  举报