from openpyxl import Workbook
wb = Workbook()
ws = wb["Sheet"]
wb.remove(ws)
ws1 = wb.create_sheet("春")
ws2 = wb.create_sheet("夏")
ws3 = wb.create_sheet("秋")
ws_spring = wb["春"]
ws_winter = wb.copy_worksheet(ws_spring)
ws_winter.title = "冬"
# 获取默认的工作表
ws = wb.active
# 添加一些数据
ws["A1"] = "Hello"
ws["B1"] = "Excel!"
# 设置工作表的保护
ws.protection.sheet = True
ws.protection.password = "oeasy"
ws_winter.sheet_properties.tabColor = "000000"
ws.sheet_view.zoomScale = 150 # 设置为50表示缩放比例为50%
wb.save("test.xlsx")
