辉煌仪奇 2022-01-17 14:35 采纳率: 48.1%
浏览 80
已结题

有两个数组,如何将其转换为xlsx对应格式

我想实现一下功能,每个大列表的小列表为一行数据
list1为必需材料
list2为选配材料
如何做出腿肿图片的样子
我自己能填充数据进去,但是做不到合并he单元格填充颜色和设置边框,最开始的文字居中也做不到
希望在fun函数中实现
表格模型

img

list1 = [[1,"单元板","/","/","/","/",5,10,50,""],
         [2,"辅材","/","/","/","/",6,11,66,""],
         [3,"电源","/","/","/","/",7,12,84,""],
         [4,"控制卡","/","/","/","/",8,13,104,""],
         [5,"处理器","/","/","/","/",9,14,126,""],
         [6,"配电箱","/","/","/","/",10,15,150,""],
         [7,"结构","/","/","/","/",11,16,176,""],
         [8,"包边","/","/","/","/",12,17,204,""],
         [9,"安装调试","/","/","/","/",13,18,234,""],]
list2 = [[1,"箱体","/","/","/","/",5,50,250,""]
         [2,"多功能卡","/","/","/","/",6,51,306,""]
         [3,"音箱、功放","/","/","/","/",7,52,364,""]
         [4,"电脑","/","/","/","/",8,53,424,""]
         [5,"运输","/","/","/","/",9,54,486,""]
         [6,"施工平台","/","/","/","/",10,55,550,""]
         [7,"综合布线","/","/","/","/",11,56,616,""]]


def fun(list1: list,list2: list,filename: str = "default.xlsx") -> None:
    """python
    
    :param list1: 必须材料详细列表
    :param list2:选配材料详细列表
    :param filename:输出excel名字
    :return:None
    """
    pass


def main():
    fun(list1,list2)


if __name__ == '__main__':
    main()

预期运行后的结果

img

  • 写回答

1条回答

      报告相同问题?

      相关推荐 更多相似问题

      问题事件

      • 已结题 1月24日
      • 已采纳回答 1月17日
      • 创建了问题 1月17日

      悬赏问题

      • ¥30 关于#网络安全#的问题:非对称加密验证
      • ¥20 关于线性代数里施密特正交化和QR分解的疑问
      • ¥15 matlab超类包含解析错误
      • ¥15 python拖拽文件问题
      • ¥15 执行import paddle代码出现错误如何解决?
      • ¥15 hisat2align exited with value 137
      • ¥15 寻找大学生合作开发软件(Delphi)
      • ¥30 AndroidBench&eMMC内存测试速度&Android
      • ¥15 W10 文件共享失败 怎么解决
      • ¥20 b站私信完整导出的方法