搬运:http://stackoverflow.com/questions/17684610/python-convert-csv-to-xlsx
import os import glob import csv from xlsxwriter.workbook import Workbook for csvfile in glob.glob(os.path.join('.', '*.csv')): workbook = Workbook(csvfile + '.xlsx') worksheet = workbook.add_worksheet() with open(csvfile, 'rb') as f: reader = csv.reader(f) for r, row in enumerate(reader): for c, col in enumerate(row): worksheet.write(r, c, col) workbook.close()
xls库:xlsxwriter ,此库简单
pypi:https://pypi.python.org/pypi/XlsxWriter/0.6.8