python 版本:2.7
只是读取excel的话可以直接使用xlrd
1、excle to json
代码如下
# -*-coding:utf8 -*-
import xlrd
from collections import OrderedDict
import json
import codecs
file_name=raw_input('请输入要转换的excle文件路径:')
wb = xlrd.open_workbook(file_name)
dict_list = []
sh = wb.sheet_by_index(0)
title = sh.row_values(0)
for r