title: How to use tkinter .after() method to create delay
body: <p>How to properly use .after() from tkinter to create a delay in between iterations without freezing the entire program until all the iterations are completed.</p>
  
  <p>Example of problem:
  total of 10 iterations, GUI will not update until the 10 iterations is completed</p>
  
  <p>What I want:
  GUI to update after every iteration, when calling .after().</p>
  
  <p>I have tried a similar code to the one below, by calling the class after every iteration, but it still freezes.</p>
  
  <pre><code>// example of a similar code i tried
  import Tkinter as tk
  import time
  
  class App():
  def __init__(self):
          self.root = tk.Tk()
          self.label = tk.Label(text="")
          self.label.pack()
          self.update_clock()
          self.root.mainloop()
  
  def update_clock(self):
          now = time.strftime("%H:%M:%S")
          self.label.configure(text=now)
          self.root.after(1000, self.update_clock)
  
  app=App()
  
  // example of my current code
  self.board = [1,1,1,1,1,1]
  
  def updateBoard(self, seed, move):
      while seed &gt; 0:
          self.board[move] += 1
          seed = seed - 1
          move = move + 1
          // here i call the function to delay the execution for 1s
          self.createDelay()
          self.displayBoard()
  </code></pre>
  
  <p>p.s. I tried time.sleep(), it freezes as well.</p>