如何从Python打印弹出式注释到Excel?

2024-04-23 11:52:00 发布

您现在位置:Python中文网/ 问答频道 /正文

是否仍要将一个注释从Python打印到Excel,并且只有在您将鼠标悬停在单元格上时才可见?你知道吗

如果是的话,有人能帮我找到正确的代码吗。非常感谢您的帮助。我真的很感激。你知道吗

我在网上找到这个,但我不确定它是否正确。我是新的编码和不知道如何实现这一点正确。你知道吗

# Set up some formatting.
worksheet1.set_column('C:C', 25)
worksheet1.set_row(2, 50)
worksheet1.set_row(5, 50)

# Simple ASCII string.
cell_text = 'Hold the mouse over this cell to see the comment.'

comment = 'This is a comment.'

worksheet1.write('C3', cell_text, text_wrap)
worksheet1.write_comment('C3', comment)

Tags: the代码text编码commentcellsomeexcel