python 修改Excel文件

from xlrd import open_workbook
from xlutils.copy import copy

rb = open_workbook('C:\\test_python\\test.xls')

rs = rb.sheet_by_index(0)
wb = copy(rb)

ws = wb.get_sheet(0)
ws.write(0,0,'changed!')

wb.save('C:\\test_python\\test.xls')

你可能感兴趣的:(python 修改Excel文件)