title: How to make a Tkinter label update?
body: <p>I have a simple tkinter GUI with a label displaying a number and a button. I have it set to the variable x, and when button is pushed, the value of x goes up by one. However, when I hit the button, the label doesn't update. How do I do this?</p>
  
  <pre><code>from tkinter import *
  
  x = 1
  def add():
      global x
      x += 1
  
  win = Tk()
  
  label = Label(win, text=x)
  label.pack()
  
  button = Button(win, text="Increment", command=add)
  button.pack()
  
  win.mainloop() 
  </code></pre>