下面的代码来自 Python 辅导网站。但是我在运行它时得到了 AttributeError 。import openpyxlfrom openpyxl.styles import Fontwb = openpyxl.Workbook()sheet = wb.get_sheet_by_name('Sheet')italic24Font = Font(size=24, italic=True)sheet['A1'].font = italic24Fontsheet['A1'] = 'Hello world!'wb.save('styled.xlsx')错误信息:> Traceback (most recent call last): File "C:\Users\zs\AppData\Local\Programs\Python\Python36\test.py", line 6, in <module> sheet['A1'].font = italic24FontAttributeError: can't set attribute
添加回答
举报
0/150
提交
取消