Just a real quick one. I has a list of variables which only change by 1 digit. I want my if
statement to refer to each individual variable, but I'm not sure how to go about it. Can you help me out?
CheckGabba1 = IntVar()
CheckGabba2 = IntVar()
CheckGabba3 = IntVar()
## etc. (x10)
## There are items in these lists (This is just to show that they are lists)
AllEventsGabba = []
SelectedEventsGabba = []
NumEvents = 10
ListIndex = 0
for EventCheck in range(NumEvents):
if (CheckGabba(ListIndex + 1)).get() == 1:
SelectedEventsGabba.append(AllEventsGabba[ListIndex])
ListIndex += 1
else:
ListIndex += 1
Obviously (CheckGabba(ListIndex + 1)
is wrong, but I'm not sure what it needs to be replaced with to get the loop to autonomously check each variable, rather than hard-writing (Which I can do, but would prefer not to).