openpyxl 文档 https://openpyxl.readthedocs.io/en/default/ 安装 pip install openpyxl 示例代码 123456789101112131415161718 from openpyxl import Workbookwb = Workbook()ws = wb.active# Data can be assigned directly to cellsws['A1'] = 42# Rows can also be appendedws.append([1, 2, 3])# Python types will automatically be convertedimport datetimews['A2'] = datetime.datetime.now()# Save the filewb.save("sample.xlsx") 赞微海报分享
近期评论