i have a lot of checkboxes (like 500) which state i want to save. Their names are like: pr0, pr1, pr2 etc.
What i want to do is:
try:
if self.ui.pr0.isChecked():
pr0 = 1
else:
pr0 = 0
except:
pr0 = 0
is there a way to put variable into line number 2?
list = []
for i in range(500):
try:
if self.ui.(variable).isChecked():
pr = 1
else:
pr = 0
except:
pr = 0
list.append(pr)
Thanks in advance.