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