Я делаю программу, которая организует доходы по годам и кварталам.
retyear() list type, Source file data with information of year = [2009, 2017, 2019, ,2020, 2021, 2022, 2099]
shtcount=len(retyear)
shtcount2=(len(retyear)*5)
--------------------------------- код проблемы --------------------------------------
wb2 = openpyxl.load_workbook("/Users/GiraffeMan/Desktop/02.xlsx", data_only=True)
file = "/Users/GiraffeMan/Desktop/02.xlsx"
ws2 = wb2['Summary']
for t in range(3, shtcount2, 5):
for p in range(0, shtcount):
print(retyear[p])
ws2 = wb2.active
ws2.cell(row=2, column=t, value="%dQ1" % retyear[p])
ws2.cell(row=2, column=t+1, value="%dQ2" % retyear[p])
ws2.cell(row=2, column=t+2, value="%dQ3" % retyear[p])
ws2.cell(row=2, column=t+3, value="%dQ4" % retyear[p])
ws2.cell(row=2, column=t+4, value="%dY Total" % retyear[p])
wb2.save(file)
double for loop извлекает только число 2099 ... Почему?