我的主要思路是:
Excel -> Html -> Image
代码如下:
# -*- coding:utf-8 -*-
__author__ = 'YangXin'
import sys
import pandas as pd
import codecs
import imgkit
reload(sys)
sys.setdefaultencoding('utf-8')
# ReportImage -> report convert include multiple sheets into pictures
class ReportImage:
def __init__(self):
pass
# excel_html -> convert excel include multiple sheets into multiple html file
# excel_file -> file
# html_path -> path
@staticmethod
def excel_html(excel_file, html_path):
html_list = []
excel_obj = pd.ExcelFile(excel_file)
sheet_list = excel_obj.sheet_names
index = 0
for i in sheet_list:
html_file = html_path + i + ".html"
excel_data = excel_obj.parse(excel_obj.sheet_names[