I want a Text label in tkinter to constantly check if its worth some value. I would like it to be in a while loop and exit it when the values match. My code doesn't work.
while user_input != str(ans):
            master = Tk()
            master.title("Math")
            master.geometry('400x400')
            eq = generate_equation(stage=current_stage)
            ans = calc(eq) 
            Label(master=master,text=f"score: {score}").grid(row=0,column=2,sticky=W)
            Label(master=master, text=f"{q_num}: {eq}").grid(row=0,column=0 ,sticky=W)
            inputtxt = tkinter.Text(master=master,height = 5, width = 20)
            inputtxt.grid()
            user_input =str(inputtxt.get(1.0,"end-1c"))
            mainloop()