python xlutils 修改表格内容

时间:2020-07-26 01:45:47   收藏:0   阅读:72

什么是xlutils

xlutils安装、基本使用

安装

pip install xlutils

基本使用

import os
import xlrd
from xlutils.copy import copy

excel_path = os.path.join(os.path.dirname(__file__), data/test_data.xls)
wb = xlrd.open_workbook(excel_path, formatting_info=True)

new_workbook = copy(wb)
sheet = new_workbook.get_sheet(0)
sheet.write(1, 3, 1000)
new_workbook.save(excel_path)

注意:

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!