title: Python tkinter loading in progress
body: <p>I would like to know how to display the text &quot;loading in progress&quot; while the final text is loading after pressing the execute button?</p>
  <pre><code>import time
  import random
  import tkinter as tk
  
  
  def load():
      my_label.config(text=&quot;Loading in progress...&quot;)  #how to display it?
      my_time = random.randint(1,10)
      time.sleep(my_time)
      my_label.config(text=&quot;Loaded!!!&quot;)
  
  root = tk.Tk()
  root.geometry('300x300')
  
  my_button = tk.Button(root, text='Load', width=20, command=load)
  my_button.pack(pady=20)
  
  my_label = tk.Label(root, text='')
  my_label.pack(pady=20)
  
  
  root.mainloop()
  </code></pre>
  <p>Thank you for your answers</p>