Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
TypeError:write()最多接受5个参数(给定6个)Python Excel_Python_Excel - Fatal编程技术网

TypeError:write()最多接受5个参数(给定6个)Python Excel

TypeError:write()最多接受5个参数(给定6个)Python Excel,python,excel,Python,Excel,我需要输入这个参数。但是python不允许我输入超过5个。有办法吗 sheet.write(26, 0, "Index", center, bold, timeFormat) 通过将属性字典传递给add_format构造函数,可以设置多个格式属性: format = workbook.add_format({'bold': True, 'align': 'center'}) 然后,您可以调用以下命令,而不是像您那样分别传递“中间”和“粗体”: sheet.write(26, 0, "Inde

我需要输入这个参数。但是python不允许我输入超过5个。有办法吗

sheet.write(26, 0, "Index", center, bold, timeFormat)

通过将属性字典传递给add_format构造函数,可以设置多个格式属性:

format = workbook.add_format({'bold': True, 'align': 'center'})
然后,您可以调用以下命令,而不是像您那样分别传递“中间”和“粗体”:

sheet.write(26, 0, "Index", format, timeFormat)

您使用的是哪种api?xlwt?AttributeError:“工作簿”对象没有“添加格式”属性