openpyxl写excel

import openpyxl


wb = openpyxl.load_workbook(r"C:\Users\Administrator\PycharmProjects\zhandian_jiekou\data\a1.xlsx")
ws = wb.worksheets[0]
ws.cell(row=1,column=3,value='aaaa')
wb.save(r"C:\Users\Administrator\PycharmProjects\zhandian_jiekou\data\a1.xlsx")

 

ws.cell(row=1,column=3,value='aaaa')

row行,column列

在第1行,第3列的单元格写入数据aaaa

 

posted @ 2017-10-24 09:25  悠然现南山  阅读(271)  评论(0编辑  收藏  举报