赞
踩
- from openpyxl import Workbook
- from openpyxl.comments import Comment
-
- if __name__ == '__main__':
- wb = Workbook()
- ws = wb.active
- comment = Comment('hello comment', 'yunan')
- comment.width = 200
- comment.height = 40
- ws['A1'].comment = comment
- wb.save('test.xlsx')
- from openpyxl import load_workbook
- from openpyxl.comments import Comment
-
- file = 'C:\yunan\\test.xlsx'
- if __name__ == '__main__':
- wb = load_workbook(filename=file)
- ws = wb.active
- comment = Comment('hello world', 'yunan')
- ws['A1'].comment = comment
- wb.save(file)
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。