我正在尝试使用 python 编写 Excel 工作表并遇到以下错误:
Traceback (most recent call last):
File "create_excel.py", line 29, in <module>
ws.row(8).write(0,'',Style.easyxf('pattern: pattern solid, fore_colourgreen;'))
File "/usr/local/lib/python2.7/site-packages/xlwt/Style.py", line 618, in easyxf
field_sep=field_sep, line_sep=line_sep, intro_sep=intro_sep, esc_char=esc_char, debug=debug)
File "/usr/local/lib/python2.7/site-packages/xlwt/Style.py", line 574, in _parse_strg_to_obj
raise EasyXFCallerError("no value supplied for %s.%s" % (section, k))
xlwt.Style.EasyXFCallerError: no value supplied for pattern.fore_colourgreen
导致上述错误的行是:-
ws.row(8).write(0,'',Style.easyxf('pattern: pattern solid, fore_colourgreen;'))
我还将该行修改为:
ws.row(8).write(0,'',Style.easyxf('pattern: pattern solid, fore-colourgreen;'))
正如一些论坛所-
代替的_
,fore-colourgreen
但无济于事。
有人可以让我知道这里有什么问题吗?