79610281

Date: 2025-05-07 10:13:13
Score: 1.5
Natty:
Report link

I want to have a grid, which I can modify before the start of the simulation, but I can't make buttons which use a function again after clicking.

Snippet:

def click_update(index):
    status[index] = abs(status[index] - 1)
    btn[index].config(bg=btn_color(status[index]))

for i in range(2500):
    files.append("button"+str(1+1)) #<--add plus 1

for i in range(len(files)):
    status.append(0) #<--remove int


btn[i].grid(row=int(i//50),column=i%50,sticky="we") #<== remove int from column keyword

for i in range(len(files)):
    btn[i].config(bg=btn_color(status[i]), command=lambda index=i: click_update(index))
    btn.append(Button)

Screenshot:

enter image description here

On the screenshot, you will see either black nor white when clicking

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Adios Gringo