How to create a Splash Screen using Tkinter?
Prerequisite: Python GUI – tkinter
Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python.
What is a Splash Screen?
A splash screen in tkinter is a tkinter window that disappears after a fixed period and then a particular operation takes place. To Create a splash screen we will use after() and destroy() method.
- The after() method assigns a time period (as argument) after which a particular operation takes place, that operation is transformed into a function and is passed as an argument in after() method.
root.after(time in millisecond, function name)
- The destroy() method is used to close the current tkinter window.
Below is a program that creates two normal Tkinter windows. The smaller window acts as a splash screen but it will not disappear.
Now we will use the below methods:
To create a splash screen in tkinter.
Below is a program that creates Splash screen in tkinter using after() and destroy() methods.
Here a splash screen is created and it stays for a particular time period and then a next operation takes place i.e a new window is generated.