python将列表按行写入至.csv文件 # coding:utf-8 import csv list=[[1,2,3,4],[5,6,7,8],[89,55,66666,5],['张三','李四','王五','tom']] f = open('222.csv','w') writer = csv.writer(f) for i in list: writer.writerow(i) f.close() 效果图:我们会发现它每一行都会有间隔,如何去掉这个间隔呢? f = open('222.csv','w',newline='') 这段代码解决了这个问题 # coding:utf-8 ...