报错为:zipfile.BadZipfile: File is not a zip file

原本代码为:

with open(template, 'r') as f:

将代码修改为:
以二进制模式打开文件即可解决:

with open(template, 'rb') as f:
Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐