Date: 2018.8.18 1、python创建excel def creat_csv(csvname): file = open(csvname, 'wb') writer = csv.writer(file) file.close 2、python往csv中写中文 import csv import codecs csvfile = file('csv_test.csv', 'wb') csvfile.write(codecs.BO
Date: 2018.8.18
1、python创建excel
def creat_csv(csvname):file = open(csvname, 'wb')
writer = csv.writer(file)
file.close
2、python往csv中写中文
import csvimport codecs
csvfile = file('csv_test.csv', 'wb')
csvfile.write(codecs.BOM_UTF8)
writer = csv.writer(csvfile)
list = ['姓名', '年龄', '电话']
writer.writerow(list)
csvfile.close()