title: How to update Ttk.Progressbar in Python?
body: <p>I have a siplme GUI that performs a few time-consuming operations. I would like to make a progressbar that would update after each of this operations. However it seems impossible to be done.</p>
  
  <p>No solutions with update or update_idletask worked (or I used it in a wrong manner). So the aim is that progressbar is updated in every loop iteration. And solution with .after() rather will not be suitable here, as the function is run bybutton click.</p>
  
  <p>Sample code:</p>
  
  <pre><code>from tkinter import *
  from tkinter.ttk import Progressbar
  from time import sleep
  
  def RunThat():
     global pb
     for i in range(0,101,10):
        pb["value"]=i
        pb.update()  #this works
        sleep(0.1)
        print(i)
  
  master=Tk()
  
  Label(master,text="Doing something...").grid(row=0,column=0,pady=10)
  Grid.columnconfigure(master,0,weight=1)
  Label(master,text="Progress:",justify=LEFT).grid(row=1,column=0,padx=25,pady=2,sticky=W+S)
  Grid.rowconfigure(master,1,weight=1)
  pb=Progressbar(master)
  pb.grid(row=2,column=0,padx=25,pady=2,sticky=W+E)   
  pb["maximum"]=100
  pb["value"]=0  
  Button(master,text="Do it",command=RunThat).grid(row=3,column=0,padx=5,pady=5)
  
  master.mainloop()
  </code></pre>