tkinter progress bar

Jason Swails jason.swails at
Tue Jul 23 15:27:59 CEST 2013

On Tue, Jul 23, 2013 at 5:38 AM, <hsiwrek at> wrote:

> Dear Christian,
> Thanks for the help. Can you please add a source example as I am new with
> Tkinter.

You can do something like this:

#!/usr/bin/env python

import Tkinter as tk
import ttk
import time

class MainApp(tk.Frame):

   def __init__(self, master):
      tk.Frame.__init__(self, master)
      self.progress = ttk.Progressbar(self, maximum=10)
      self.progress.pack(expand=1, fill=tk.BOTH)
      self.progress.bind("<Button-1>", self._loop_progress)

   def _loop_progress(self, *args):
      for i in range(10):
         # Necessary to update the progress bar appearance
         # Busy-wait

if __name__ == '__main__':
   root = tk.Tk()
   app = MainApp(root)
   app.pack(expand=1, fill=tk.BOTH)

This is a simple stand-alone app that (just) demonstrates how to use the
ttk.Progressbar widget.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list