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

  

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