title: How to temporarily pause a GUI in Tkinter?
body: <p>I understand that this question is repetitive, but for my code, none of the other answers(using <code>after</code>, <code>time.sleep</code>) have helped at all. Here is my code:</p>
  
  <pre><code>from tkinter import *
  import time,random
  root = Tk()
  
  class Simon:
      def __init__(self):
          print('SIMON')
          self.red = PhotoImage(file="Red.gif")
          self.blue = PhotoImage(file="Blue.gif")
          self.green = PhotoImage(file = "Green.gif")
          self.yellow = PhotoImage(file= "Yellow.gif")
          self.white = PhotoImage(file= "Blankimage.gif")
          self.randlist=[]
          self.storerand=0
  
      def createpattern(self):
      ##    for n in range(4):
      ##        self.storerand=random.randint(1,4)
      ##        self.randlist.append(self.storerand)
      ##        self.storerand=0
      ##    print(self.randlist)
          self.randlist=[1]
  
      def pause(self):
          for n in range(0,len(self.randlist)):
              if self.randlist[n]==1:
                  self.button1=Button(root, image = self.red)
                  self.button2=Button(root, image=self.white)
                  self.button3=Button(root,image = self.white)
                  self.button4=Button(root, image = self.white)
                  print('1')
              elif self.randlist[n]==2:
                  self.button1=Button(root,image = self.white)
                  self.button2=Button(root, image=self.blue)
                  self.button3=Button(root,image = self.white)
                  self.button4=Button(root, image = self.white)
                  print('2')
              elif self.randlist[n]==3:
                  self.button1=Button(root,image = self.white)
                  self.button2=Button(root, image=self.white)
                  self.button3=Button(root,image = self.green)
                  self.button4=Button(root, image = self.white)
                  print('3')
              elif self.randlist[n]==4:
                  self.button1=Button(root,image = self.white)
                  self.button2=Button(root, image=self.white)
                  self.button3=Button(root,image = self.white)
                  self.button4=Button(root, image = self.yellow)
                  print('4')
  
      def grid(self):
          self.button1.grid(row=0,column=0)
          self.button2.grid(row=0,column=1)
          self.button3.grid(row=1, column=0)
          self.button4.grid(row=1,column=1)
  
  simon=Simon()
  simon.createpattern()
  simon.pause()
  root.mainloop()
  </code></pre>
  
  <p>I need to make a <code>blink</code> function (which is currently my <code>pause</code> function), but if I use <code>sleep</code> it stops my code and I don't really know how to implement the after method in this case. Any suggestions?</p>