I am quite new to Python, but when I click on one of the buttons, I want the text of the label (the label that has "ctext" in the buttonClicked function) to change based on what formula I want it to be. I tried adding a value to the buttonClicked function, but when I did that it made the "command=buttonClicked(value)" static and didn't happen after I clicked the button.
Here's a portion of my code:
def buttonClicked():
formulac = tk.Label(root, text='Formula:')
formula = tk.Label(root, text= ctext) #"Insert formula" must be a string variable
formulac.config(font=("helvetica", 30))
canvas1.create_window(1500, 150, window = formulac)
formula.config(font=("helvetica", 30))
canvas1.create_window(1500, 200, window=formula)
entry1 = tk.Entry(root)
canvas1.create_window(1500, 250, window=entry1)
ctext = "Square"
formula1 = tk.Button(text= "Formula", command= buttonClicked, bg="brown", fg = "white", font =("helvetica", 9))
canvas1.create_window(120, 100, window = formula1)
formula2 = tk.Button(text= "Formula", command= buttonClicked, bg="brown", fg = "white", font =("helvetica", 9))
canvas1.create_window(120, 130, window = formula2)