title: How do you refresh a window in Tkinter
body: <p>If I created Tkinter window with some text that filled the whole window and now wanted to replace the window with a new text, is there a way to refresh the window? </p>
  
  <p>For Example:</p>
  
  <pre><code>    a= 100
      win= Tk() 
      win.geometry("500x300")
      while a &gt; 0:
         if a%2 == 0:
             lbl = Label (win, bg = "purple")
             lbl.pack()
         else:
             lbl = Label (win, bg = "blue")
             lbl.pack()
         a= x-1
  </code></pre>
  
  <p>The problem with this code is that the Tkinter window does not refresh and just provides the end result instead of showing the windows changing colors.
  Thanks for the help! </p>