原文件
import xlrd
file = 'demo.xlsx'
sheet_name='Sheet1'
work = xlrd.open_workbook(file)
work_sheet = work.sheet_by_name(sheet_name)
print(work_sheet.cell_value(2, 0)) # 讀取第3行的第1列
# coding: utf-8
import xlrd
from xlutils.copy import copy
file = 'demo.xlsx'
sheet_name = 'Sheet1'
work = xlrd.open_workbook(file)
work_sheet = work.sheet_by_name(sheet_name)
# 對數據表格進行復制
new_file = copy(work)
ws = new_file.get_sheet(0)
# 往新表格寫數據
ws.write(4, 0, '4')
ws.write(4, 1, 'Danny')
# 保存
new_file_name = 'new_demo.xlsx'
new_file.save(new_file_name)