What this is meant to do is pack buttons to root, with each button having a different text and argument being passed in from the 'boards' list in the loop. I have tried using 'in range', accessing that element in that loop but didn't work either.
def BoardSelect():
Clear()
boards = getBoards()
for board in boards:
Button(root, **config, bg="dark gray", text=board, command=lambda:PresetSelect(board)).pack(fill="x", pady=2)
Button(root, **config, bg="dark gray", text="All", command=lambda:ImageViewer("all")).pack(fill="x", pady=2)
Button(root, **config, bg="red", text="Back", command=lambda:mainMenu()).pack(fill="x", pady=2)