3.使用 xlutils 修改Excel数据
|
1
2
3
4
5
6
7
8
9
10
|
# -*- coding:utf-8 -*-import xlrdfrom xlutils.copy import copybook1 = xlrd.open_workbook('D:\Excel.xls') # 打开要修改的excelbook2 = copy(book1) # 拷贝一份原来的excelsheet = book2.get_sheet(0) # 获取第几个sheet页sheet.write(1, 1, 28) # 写入需要修改的行、列及修改后的值sheet.write(5, 0, 'mike')book2.save('D:\Excel.xls') |













