def getRow(arr, letter):
i = 15;
u = 0;
while i < 1000:
i = i + 1
u = u + 1
if (sheet[letter + str(i)].value != None):
arr.append(sheet['I' + str(i)].value)
else:
break;
print(arr)
el_1 = element(name = getRow(element.name, "I"),
leg = getRow(element.leg, "J"),
itog = getRow(element.itog, "K"),
material = getRow(element.material, "L"),
primechanie = getRow(element.primechanie, "M"),
vrezki = getRow(element.vrezki, "N"),
objLegVrez = getRow(element.objLegVrez, "O"),
gib = getRow(element.gib, "P"),
count = getRow(element.count, "Q"))
from dataclasses import dataclass
@dataclass
class Element:
name: list
leg: list
itog: list
material: list
primechanie: list
vrezki: list
objLegVrez: list
gib: list
count: list
def getRow(letter):
i = 15
u = 0
arr = []
while i < 1000:
i = i + 1
u = u + 1
if (sheet[letter + str(i)].value != None):
arr.append(sheet['I' + str(i)].value)
else:
break
return arr
el_1 = Element(
name=getRow("I"),
leg=getRow("J"),
itog=getRow("K"),
material=getRow("L"),
primechanie=getRow("M"),
vrezki=getRow("N"),
objLegVrez=getRow("O"),
gib=getRow("P"),
count=getRow("Q")
)