I need to do this action once under certain conditions in a for loop to stop duplicates appearing in the checkboxes. Theoretically, this should work I believe but when the conditions are met for this if statement (cycles == 1 & len(tasks) > 1) it skips over the statement anyway which really confuses me. I have been trying to debug this with breakpoints but I can't figure it out.
tasks = [a, b]
def addToList():
cycles = 0
for x in range(len(tasks)):
cycles += 1
if cycles == 1 & len(tasks) > 1:
checkList.destroy()
checkList = Checkbutton(viewTab,text=tasks[x])
checkList.pack(anchor='w',side=BOTTOM)
listInput
and how you're callingaddToList
, it's hard to say what the issue is or what's causing it. By the way - did you meanand
(logical and) instead of&
(binary/bitwise and)?checklist.destroy()
?