title: How can i update a tkinter window with a new defined variable?
body: <p>I want to create two windows with one button in the first one one and one label in the second.
  When i press the button the label in the second window should refresh and display the variable plus 1.</p>
  
  <p>I dont want to close the second window and re open it afterwards.
  Any ideas how that could be done?</p>
  
  <pre><code>import tkinter as tk
  
  text = 1
  root = tk.Tk()
  root2 = tk.Tk()
  
  label = tk.Label(root, bg="green", text=text, fg="blue")
  label.place(relx=0.1, rely=0.1, relheight=0.3, relwidth=0.3)
  
  def plus():
      global text
      text = text + 1
  
      print(text)
  
  
  button = tk.Button(root2, bg="blue", text="Button", command=plus)
  button.pack()
  
  root.mainloop()
  root2.mainloop()
  </code></pre>
  
  <p>This code should do the basics but the line to refresh the second window is still missing.</p>
  
  <p>Hopefully anyone can tell me how to that :)</p>