首页 > 编程语言 > 详细

Python办公自动化 | EXCEL读取和写入

时间:2020-07-07 09:45:08      阅读:54      评论:0      收藏:0      [点我收藏+]

 

 

 1 import xlrd
 2 import xlwt
 3 
 4 
 5 xlsx = xlrd.open_workbook(rD:\pycharm\learning\autowork\test.xlsx)
 6 table = xlsx.sheet_by_index(0)
 7 # table = xlsx.sheet_by_name(‘Sheet1‘)
 8 print(table.cell_value(0, 0))
 9 print(table.cell(0, 0).value)
10 print(table.row(0)[0].value)
11 
12 new_workbook = xlwt.Workbook()
13 new_sheet = new_workbook.add_sheet(aaa)
14 new_sheet.write(1, 1, hello word)
15 new_workbook.save(rD:\pycharm\learning\autowork\test2.xls)

 

Python办公自动化 | EXCEL读取和写入

原文:https://www.cnblogs.com/mba1398/p/13258732.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!