Blog

6/recent/ticker-posts

Python Tkinter Loading Screen - Splash Screen GUI

 

Python Tkinter Loading Screen 



The GUI (Graphical User Interface), is a system of interactive user interface that allows users to communicate with electronic graphical components like icons, buttons and menu.

 

Python Tkinter Loading Screen GUI

                                       


In this article, we will learn how to create a python tkinter loading screen or splash screen. 

About this project 

This Python Tkinter Loading Screen or splash screen GUI was made using tkinter.ttk library. The loading screen includes a progress bar that displays a counting label in percentage. The progress bar moves along with the label counting in percentage unto it reaches a maximum of "100%" then opens another page as Homepage.


You Can Also Watch The Tutorial Video Below For More Understanding


Full Tutorial Video From YouTube ..

 provides fast and easy way to create GUI Applications. Tkinter is popular, simple and widely used and also has a ton of references to get you started.

Creating A Window

Let's start by creating a window. It's really quite simple using Tkinter. Let's create a new python file called main.py.

python
from tkinter import *
root = Tk()
root.geometry('530x430')
root.mainloop()

output: ......


A blank empty window.


In the first line inside the code snippets, we imported all the functions for the Tkinter module. Using import *, will import all. In the second line we used " root " and assigned it to Tk() which is the standard name for initializing the Tk root widget. The root widget, which is the main window and our parent window, has to be created before any other windows. Also, there can be only one root. Then we gave our window a size using geometry with width: 900 and height: 600. Finally, the last line runs the main loop event . 

Now, after running our window you will noticed that the window is not aligned exactly at the center of the screen. So let's fix it.


python
from tkinter import *

root = Tk()

# Making window align to the center
height = 430
width = 530
x = (root.winfo_screenwidth()//2)-(width//2)
y = (root.winfo_screenheight()//2)-(height//2)
root.geometry('{}x{}+{}+{}'.format(width, height, x, y))

root.mainloop()


You can download the starter code below to follow along




After downloading the starter code above follow along in the tutorial video below

PART ONE (1)

Part 1 Tutorial Video From YouTube ..


PART ONE (2)

Part 2 Tutorial Video From YouTube ..


Summary

In this article, we looked at the graphical user interfaces of a modern python tkinter loading screen or splash screen made using Python Tkinter.

My name is Sen Gideons, If you have any questions or comments about this tutorial, please feel free to leave them in the comments section below.



Post a Comment

0 Comments

Ad Code

Responsive Advertisement

Hot Post