title: How to update a progress bar in a loop?
body: <p>What is the easy method to update Tkinter progress bar in a loop?</p>
  
  <p>I need a solution without much mess, so I can easily implement it in my script, since it's already pretty complicated for me.</p>
  
  <p>Let's say the code is:</p>
  
  <pre><code>from Tkinter import *
  import ttk
  
  
  root = Tk()
  root.geometry('{}x{}'.format(400, 100))
  theLabel = Label(root, text="Sample text to show")
  theLabel.pack()
  
  
  status = Label(root, text="Status bar:", bd=1, relief=SUNKEN, anchor=W)
  status.pack(side=BOTTOM, fill=X)
  
  root.mainloop()
  
  def loop_function():
      k = 1
      while k&lt;30:
      ### some work to be done
      k = k + 1
      ### here should be progress bar update on the end of the loop
      ###   "Progress: current value of k =" + str(k)
  
  
  # Begining of a program
  loop_function()
  </code></pre>