02python excel开发模块openpyxl 写入操作

https://openpyxl.readthedocs.io/en/stable/tutorial.html

from openpyxl import Workbook
wb = Workbook()

# grab the active worksheet
ws = wb.active

# Data can be assigned directly to cells
ws['A1'] = 42

# Rows can also be appended
ws.append([1, 2, 3])

# Python types will automatically be converted
import datetime
ws['A2'] = datetime.datetime.now()

# Save the file
wb.save("C:/Users/laiwu/Desktop/一键式统计/纳税申报表.xlsx")
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页