I am building a workout timer / stopwatch program as a way of learning tkinter with python, and I've figured out most of the kinks so far, now I am just dealing with the fact that I can't reference the labels I create with the following function.
def create_action_card(name, time, row):
action_card = Label(
root, text="\n\n" + name + "/ " + str(time) + " sec",
width=50, height=4,
bg="dark orange", anchor="n",
highlightthickness=2, highlightbackground="black",
relief=RAISED)
action_card.grid(row=row, column=3, rowspan=2, padx=1)
The thought is that this functions creates a label/card that shows which exercise to do, and for how many seconds to do it. Before starting the timer, the user builds a stack of cards, that represent the entire workout. I want to delete a card when the time is up, but I don't know how to use the .destroy() function when I can't reference the card, as they don't have unique variable names.
I was thinking maybe storing them in a dictionary, and then removing them there, but I am not sure how that would work.
Any ideas on /g/?