您的位置:首页 > 编程语言 > Python开发

【python】操作excel——xlrd xlwt xlutils

2016-12-14 11:35 337 查看
from xlutils.copy import copy
import xlrd
# import xlutils

#打开已存在的excel
rb=xlrd.open_workbook('D:\\1.xls',formatting_info=True, on_demand=True)
rs=rb.sheet_by_index(0).cell(0,0).value

#复制
wb=copy(rb)
#插入or修改数据
wb.get_sheet(0).write(1,0,'7')
#保存(保存的路径,默认为python项目的路径)
wb.save('1.xls')


 参考文档: http://xlutils.readthedocs.io/en/latest/copy.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: