
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How to create a Splash Screen using Tkinter?
Let us suppose that we want to create a splash screen using tkinter. To create a splash screen, we will follow the steps given below −
Create a splash screen with some labels in it.
Make the splash screen borderless using the overrideredirect method.
Create a function for the main window which will appear for a time just after the splash screen.
Now using the after method, we can define the time for which the main window will appear.
Example
#Importing the tkinter library from tkinter import * #Create an instance of tkinter frame splash_win= Tk() #Set the title of the window splash_win.title("Splash Screen Example") #Define the size of the window or frame splash_win.geometry("700x200") #Remove border of the splash Window splash_win.overrideredirect(True) #Define the label of the window splash_label= Label(splash_win, text= "Hello World!", fg= "green", font= ('Times New Roman', 40)).pack(pady=20) def mainWin(): splash_win.destroy() win= Tk() win.title("Main Window") win.geometry("700x200") win_label= Label(win, text= "Main Window", font= ('Helvetica', 25), fg= "red").pack(pady=20) #Splash Window Timer splash_win.after(5000, mainWin) mainloop()
Running the above code will generate the output and will show the splash screen and after some time, the main window.
Output
- Related Articles
- How to create a simple screen using Tkinter?
- How do I create a splash screen on Android App?
- How can we implement a splash screen using JWindow in Java?\n
- How to create a timer using tkinter?
- How to run splash using Docker toolbox?
- How to create a password entry field using Tkinter?
- How to create transparent widgets using Tkinter?
- Adding an animated loader and splash screen in a React Native app
- How to center a window on the screen in Tkinter?
- How to get the screen size in Tkinter?
- How to display full-screen mode on Tkinter?
- Python to create a digital clock using Tkinter
- How to create a borderless fullscreen application using Python-3 Tkinter?
- How do I create a popup window using Tkinter?
- How to create a Tkinter toggle button?

Advertisements