python csv
Python写了一个可以提取csv任一列的代码,欢迎使用。Github链接
两个list写入csv文件
column1,column2
#coding:utf-8 import csv column1 = [1,2,3] column2 = [4,5,6] L= (column1,column2) change = zip(column1,column2) #按行写入 csvfile111 = file('csv_row.csv', 'wb') writer = csv.writer(csvfile111) writer.writerows(L) # #按列写入 csvfile111 = file('csv_line.csv', 'wb') writer = csv.writer(csvfile111) writer.writerows(change)