title: How do I make time.sleep() work with tkinter?
body: <p>I'm trying to show a sequence of numbers on the screen at regular intervals. </p>
  
  <p>I'm new to python so it may be something obvious but I have tried <code>.after</code> and <code>pygame.time.wait</code>, but neither worked.</p>
  
  <p>this is the code:</p>
  
  <pre><code>from tkinter import*
  from random import *
  import time
  
  
  
  my_list = []
  
  
  
  
  def Create_NUM(event):
      x = 0
  
      for x in range(level + 2):
          button1.destroy()
          num = randint(1, 100)
          my_list.append(num)
          Label(root, text=num,fg="red").pack()
          one.pack()
          time.sleep(2)
  
  
  
  
  
  root=Tk()
  
  num = 0
  level = 1
  bottomFrame = Frame(root)
  bottomFrame.pack(side=BOTTOM)
  
  button1 = Button(bottomFrame, text="Click to start game",fg="red")
  button1.bind("&lt;Button-1&gt;", Create_NUM)
  button1.pack()
  
  
  
  root.mainloop()
  </code></pre>