[英]Python — TypeError: format() takes at most 2 arguments (3 given)
[英]TypeError: write() takes at most 5 arguments (6 given) Python Excel
我需要输入这个参数。 但是python不允许我输入超过5个。是否有办法?
sheet.write(26, 0, "Index", center, bold, timeFormat)
您可以通过将属性字典传递给add_format()构造函数来设置多种格式属性:
format = workbook.add_format({'bold': True, 'align': 'center'})
然后,不必像以前那样分别传递“ center”和“ bold”,而是可以调用:
sheet.write(26, 0, "Index", format, timeFormat)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.