title: Making an image flash in python
body: <p>I am trying to flash an image using pack() and pack_forget().</p>
  
  <p>We are building a custom BMW, and the lights are run with Raspberry Pi. I have the LED blinkers working using gpiozero, but now I need to show it on a display on the dash. I am able to hide and show the image using Label.pack_forget() and Label.pack() respectively in a function, but I cant get it to flash. I have tried the following code.</p>
  
  <p>This works:</p>
  
  <pre><code>def showBG():
      background_label.pack()
  
  def hideBG():
      background_label.pack_forget()
  
  hideBttn = tk.Button(window, text="Hide Arrow", command = hideBG)
  showBttn = tk.Button(window, text="Show Arrow", command = showBG)
  </code></pre>
  
  <p>This does not:</p>
  
  <pre><code>import tkinter as tk
  from time import sleep
  
  def flashBG():
      for i in range(0, 3):
          background_label.pack()
          sleep(.7)
          background_label.pack_forget()
          sleep(.3)  
  
  showHideBttn = tk.Button(window, text = "Flash Arrow", command = flashBG)     
  </code></pre>
  
  <p>The first example shows and hides the Arrow as expected: Press the Hide Button and it disappears, press the Show Button and it appears.</p>
  
  <p>The second example is supposed to flash 3 times like the blinker in your car on the dash. ON wait .7 secs, OFF wait .3 secs X3...</p>
  
  <p>No errors, I click the Show Hide Button and the Arrow simply disappears when the for loop terminates.</p>