求解openpyxl的问题!
本帖最后由 君无泪 于 2021-9-22 22:05 编辑from openpyxl import Workbook
wb = Workbook(write_only = True)
ws = wb.create_sheet()
from openpyxl.cell import WriteOnlyCell
from openpyxl.comments import Comment
from openpyxl.styles import Font
cell = WriteOnlyCell(ws, value="hello world")
cell.font = Font(name='Courier', size=36)
cell.comment = Comment(text="A comment", author="Author's Name")
ws.append()
wb.save('write_only_file.xlsx')
求解Comment()详解!
为什么要传入两个参数? 本帖最后由 suchocolate 于 2021-8-19 22:53 编辑
https://openpyxl.readthedocs.io/en/stable/comments.html
https://openpyxl.readthedocs.io/en/stable/_modules/openpyxl/comments/comments.html#Comment
批注和批注者 text是批注(批注内容)
author是批注者(谁批注的)
批注者的信息在excel的左下角有显示 灰晨 发表于 2021-8-19 10:51
text是批注(批注内容)
author是批注者(谁批注的)
批注者的信息在excel的左下角有显示
受教了,谢谢!
页:
[1]