Python中办公软件(创建excel)

from collections import OrderedDict#有序字典
from pyexcel_xls import save_data #读取xls数据

def makeExcelFile(path,data):
dic=OrderedDict()
for sheetName,sheetValue in data.items():
d={}
d[sheetName]=sheetValue
dic.update(d)
save_data(path,dic)

path=r"D:x.xls"
makeExcelFile(path,{"表1":[[3,2,1],[6,5,4],[9,8,7]],
"表2":[[31,21,11],[61,51,41],[91,81,71]]})

posted @ 2019-03-10 23:20  飞飞阿  阅读(267)  评论(0编辑  收藏  举报