Tkitner: How to display Progressbar with different speed
If Progressbar
in 'indeterminate'
mode run too fast or too slow then
you can use after(milliseconds, function_name)
to run periodically own function
which will use step()
to change value in ProgressBar
.
If you use different milliseconds
or different value in step()
then it will move with different speed.
import tkinter as tk
from tkinter import ttk
def change():
p.step(10)
root.after(100, change) # run again after 100ms,
root = tk.Tk()
p = ttk.Progressbar(root, mode='indeterminate')
p.pack()
change() # run first time
root.mainloop()
If you like it
Buy a Coffee
Buy a Coffee