第一种方法:打开Excel文件,另存为 .csv文件便可,利用读取csv的方式html
第二种方法:python
第一步: pip install pyexcel-xls
环境:python3.6app
工具:pycharm.3 community工具
上代码:.net
# 读取文件excel
# pyexcel_xls 以 OrderedDict 结构处理数据
from collections import OrderedDict
from pyexcel_xls import get_data
from pyexcel_xls import save_data
def read_xls_file():
xls_data = get_data(r"D:\read_test.xlsx")
print ("Get data type:", type(xls_data))
for sheet_n in xls_data.keys():
print (sheet_n, ":", xls_data[sheet_n])
if __name__ == \__main__:
read_xls_file()code
# 写入文件htm
from collections import OrderedDict
from pyexcel_xls import get_data
from pyexcel_xls import save_data
def read_xls_file():
xls_data = get