# 方式一
from openpyxl import load_workbook
wb = load_workbook("files/p1.xlsx")
sheet = wb.worksheets[0]
# 找到单元格并修改
cell = sheet.cell(1,1)
cell.value = "新的开始"
# 另存一个Excel文件
wb.save("files/p2.xlsx")
# 方式二
from openpyxl import workbook
wb = workbook.Workbook()
sheet = wb.worksheets[0]
cell = sheet.cell(1,1)
cell.value = "新的开始"
wb.save("files/p2.xlsx")