如何在Python OpenPyXL中更改字体大小
问题描述:
如何更改单元格的字体大小?我正在使用OpenPyXL.
How do I change the font size of a cell? I am using OpenPyXL.
如果不使用完美的语法和拼写键入上面的内容,这将不允许我发送此问题,所以最后几句话人们应该知道我的意思.
It will not let me send this question without typing the above with perfect grammar and spelling, so the last few words people should know what I mean.
答
这对我有用:
from openpyxl.styles import Font
fontStyle = Font(size = "10")
ws.cell(row = 1, column = 1, value = 'Test Text').font = fontStyle
我正在使用openpyxl版本:2.3.2
I'm using openpyxl version: 2.3.2