Code in Python
Machine Learning and Deep Learning Blogs

Learn How to add a Status bar in Tkinter

In the previous chapter, we learned how to make toolbar and drop down menus. In this chapter, we will learn how to make a status bar. It is just a text written on the bottom of the window that shows the status of the file on which you are working on or any other thing. To add a status bar, make a label first.

status = Label(var, text="processing…", bd=1, relief=SUNKEN, anchor=W) 

In the label, first, we will specify where we have to put the status bar. Here, we have one window so we are using var. The text is used to specify the text to be shown on the label. Bd is used for the border. Whenever we create a label, we can add border to it.

Relief is a parameter that allows us to manage how we want our label to appear. Here, we want it to appear sunken in our screen.  If we add just a label at the bottom of the screen, it looks kind of weird, but if we have border and relief, it looks like a part of the window.

Anchor allow us to decide where the label should be pinned. W is used for the West, N is for North, E is for East and S is for South. We want to show it on the left side of the screen so we have used W. Now, to show this status bar in our main window, we need to pack it up.

status.pack(side=BOTTOM, fill=X) 

The status bar will be displayed on the bottom of the window and it will cover the horizontal part of the screen no matter how much we stretch it.

Final Code – Status bar

Complete program for the status bar is,

from tkinter import *
var = Tk()

status = Label(var, text="processing…", bd=1, relief=SUNKEN, anchor=W)
status.pack(side=BOTTOM, fill=X)


status bar

Rahul Choudhary
Follow me

Rahul Choudhary

Rahul is a Python enthusiast. He likes to explore whatever is new in Python world. Rahul is a car fanatic and a serial chiller. Follow him on Facebook and Twitter.
Rahul Choudhary
Follow me

Latest posts by Rahul Choudhary (see all)


  1. I discovered your weblog website on google and test a few of your early posts. Continue to keep up the superb operate. I simply extra up your RSS feed to my MSN Information Reader. Seeking ahead to reading more from you in a while!…

Leave a Reply

Your email address will not be published.


© 2018 Code in Python