xlrd 读取不支持此文件格式,你可以将文件后缀更改: t.xlsx ——》 t.xls
进行测试一下
在创建工作表的时候,添加cell_overwrite_ok=True
例如:
ws = wb.add_sheet("CNY",cell_overwrite_ok=True)
在ws.write(i+2,j,val,ztstyle) 这行这里再添加一个if判断 ,只有第一行才应用 ztstyle,后面不应用,这样第一行就是绿色 后面几行就没了
拼写错误,修改为
titlestyle.font=titlefont
错误提示XFstyle没有 num_format_str 这个属性,你把完整代码贴下,我看下
https://xlwt.readthedocs.io/en/latest/ 可以在这里看,或者查看源码看