title: Constantly checking a text box in tkinter
body: <p>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.</p>
  <pre class="lang-py prettyprint-override"><code>while user_input != str(ans):
  
              master = Tk()
              master.title(&quot;Math&quot;)
              master.geometry('400x400')
  
              eq = generate_equation(stage=current_stage)
              ans = calc(eq) 
              Label(master=master,text=f&quot;score: {score}&quot;).grid(row=0,column=2,sticky=W)
              Label(master=master, text=f&quot;{q_num}: {eq}&quot;).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,&quot;end-1c&quot;))
  
              mainloop()
  </code></pre>