<filename>GUI/19 - Progress Bar.py
from tkinter import *
from tkinter.ttk import *
import time


def start():
    task = 10
    x = 0
    while x < task:
        time.sleep(0.5)
        bar['value'] += 10
        x += 1
        percent.set(str(int(x/task)*100)+"%")
        janela.update_idletasks()


janela = Tk()

percent = StringVar()

bar = Progressbar(janela, orient=HORIZONTAL)
bar.pack(pady=10)

botao = Button(janela, text="Confirmar", command=start).pack()

percent_label = Label(janela, textvariable=percent).pack()

janela.mainloop()

<filename>GUI/19 - Progress Bar.py
from tkinter import *
from tkinter.ttk import *
import time


def start():
    task = 10
    x = 0
    while x < task:
        time.sleep(0.5)
        bar['value'] += 10
        x += 1
        percent.set(str(int(x/task)*100)+"%")
        janela.update_idletasks()


janela = Tk()

percent = StringVar()

bar = Progressbar(janela, orient=HORIZONTAL)
bar.pack(pady=10)

botao = Button(janela, text="Confirmar", command=start).pack()

percent_label = Label(janela, textvariable=percent).pack()

janela.mainloop()
