joe munapo
joe munapo

Reputation: 15

Tkinter Loading wheel or progress bar

I want a python code to show a loading wheel or something on count down, currentry i'm using 3.2.1... count down but i want something like a loading wheel

    def button1Clicked():
        print("button was clicked")
        exitButton.pack_forget()
        startButton.pack_forget()
        start1Button.pack_forget()
        take1Photo(1)

def takePhoto(snap):
    if snap > 0:
        countdown(3)
        win.after(10000, takePhoto, snap-1)
    else:
        label["text"] = "Please wait..."
        win.after(100, assAndPrint)

def take1Photo(snap):
    if snap > 0:
        countdown(3)
        win.after(10000, take1Photo, snap-1)
    else:
        label["text"] = "Please wait..."
        win.after(100, assAndPrint1) 

Upvotes: 0

Views: 12052

Answers (1)

TmZn
TmZn

Reputation: 407

Assuming "root" is your Tk Window, here's the simplest example on how you could do it :

p = Progressbar(root,orient=HORIZONTAL,length=200,mode="determinate",takefocus=True,maximum=100)
p.pack()            
for i in range(100):                
    p.step()            
    root.update()

Don't forget to import Progressbar :

from tkinter.ttk import Progressbar

Upvotes: 2

Related Questions