Let’s suppose that we are creating an application which interacts with sources and files such as downloading the files, tracking the file. In order to make a progressbar for such an application, we will use the tkinter.ttk package that includes the Progressbar module.

Initially, we will instantiate an object of Progressbar which has orientation of Horizontal. Then, we will define a function to increase the value of the progressbar and keep updating it.

## Example

In the following example, we have created a download progress bar by updating its value.

#Import the required libraries
from tkinter import *
from tkinter.ttk import *
import time

#Create an instance of tkinter frame
win= Tk()

#Set the geometry of frame
win.geometry("620x400")

#Define a function
def start():
x=0
time.sleep(1)
bar['value']+=10
x+=1

bar= Progressbar(win, orient=HORIZONTAL, length=300)

#Create a button
win.mainloop()