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()
Python convert csv to xlsx