tkinter progress bar code example

Example 1: python progress bar

from tqdm import tqdm
for i in tqdm(range(0,int(10E6))):
  continue

Example 2: tkinter progresse bar color

import Tkinter as tk
import ttk as ttk
root = tk.Tk()
frame = tk.Frame(root)
frame.grid()
s = ttk.Style()
s.theme_use('clam')
s.configure("red.Horizontal.TProgressbar", foreground='red', background='red')
ttk.Progressbar(frame, style="red.Horizontal.TProgressbar", orient="horizontal", length=600, mode="determinate", maximum=4, value=1).grid(row=1, column=1)
frame.pack()

Example 3: tkinter progresse bar color

12345678910111213import tkinter as tk
from tkinter import ttk
 
root = tk.Tk()
frame = tk.Frame(root)
 
style = ttk.Style()
style.theme_use('alt')
style.configure("green.Horizontal.TProgressbar",
            foreground='green', background='green')
ttk.Progressbar(frame, style="green.Horizontal.TProgressbar", mode='determinate', maximum=4, value=2).pack()
frame.pack()
tk.mainloop()