A powerful and flexible Tkinter-based splash screen library
Project description
tksplashscreen
A lightweight, flexible tkinter splash screen helper for Python apps.
- PyPI package name:
tksplashscreen - License: MIT
- Python: 3.6+
Lifecycle note: Creating a
SplashScreen(...)only configures it. Callshow()to display it.
Installation
pip install tksplashscreen
Quick usage
See demo.py and mini_demos.py in the repo for full runnable examples.
from splashscreen import SplashScreen
splash = SplashScreen("Loading...", close_after=3)
splash.show()
splash.root.mainloop()
What you can do
- Preset placement (
TL,TC,TR,CL,C,CR,BL,BC,BR) or{ "x": 100, "y": 200 }- T* - Top
- C* - Center
- B* - Bottom
- *L - Left
- *C - Center
- *R - Right
- Standalone splash (no main window) or attached to an existing
tk.Tk - Optional progress bar (determinate / indeterminate)
- Update text/colors while running
- Optional close button
- Optional main-window blocking (modal behavior)
API (short reference)
Constructor
SplashScreen(
message: str,
close_after: float | None = None,
placement: str | dict = "BR",
font: str | tuple | None = None,
bg: str = "#00538F",
fg: str = "white",
mainwindow: "tk.Tk" | None = None,
close_button: bool = False,
title: str | None = None,
progressbar: dict | None = None,
block_main: bool = False,
)
Methods
show(blocking: bool = False)- Display the splashscreenupdate_message(text: str, append: bool = False)- Update text in the splash screen, with or without appendingupdate_color(color: str)- Change the background color of the splash screenstep_progressbar(step_count: float = 1.0)- Step progressbar specified number of stepsset_progress(value: float)- Set progressbar to specific valueclose(delay: float = 0)- Close the splash screenis_shown() -> bool- Check if splash screen is displayed
Common pitfalls / FAQ
Why do I get "Splash screen not shown yet. Call show() first."?
You created the object but never displayed it.
✅ Do this:
splash = SplashScreen("Loading…")
splash.show()
My splash appears and then immediately disappears
If your program exits right after calling show(), the process ends and the window closes.
- If you’re using a standalone splash in a short script, keep the process alive (see
mini_demos.py). - If you’re attached to a
tk.Tk()app, make sure your app’s mainloop continues running.
“Standalone non-blocking” closes my main window / app
Standalone means the splash is not the app’s main root window. If you create a Tk() for the splash and then quit/destroy it incorrectly, you might terminate the program.
Tips:
- Prefer attaching to your app’s
rootwhen you already have one. - For standalone usage, rely on
SplashScreen(...).show(blocking=True)if you want the splash to drive the event loop.
Progress bar doesn’t move
For determinate mode you must advance it:
- call
step_progressbar(...)per step, or - call
set_progress(value).
My UI freezes while the splash is visible
If you do long work on the tkinter/UI thread, everything freezes.
- Do heavy work in a worker thread/process, and only schedule UI updates back onto tkinter.
- Use the demo files for patterns (
demo.py,mini_demos.py).
The splash size/position seems off
Text size, wrapping, and progress bars affect geometry.
- Use a larger
wraplength(or shorter text) for better sizing. - Try a different placement, or provide explicit
{x, y}.
Contributing
Issues and PRs are welcome.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tksplashscreen-2.1.tar.gz.
File metadata
- Download URL: tksplashscreen-2.1.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d76f17e5a197593b541eb5f0f677b35f73e3a6274ba5cdcb3bd4ac4e21105963
|
|
| MD5 |
3f7cd90cef1b2e97e62f26160ac0582b
|
|
| BLAKE2b-256 |
b65f2e91f2ce331d21c1aff15f15eda80892900b8502dc9b8a1e64356c7bb1aa
|
File details
Details for the file tksplashscreen-2.1-py3-none-any.whl.
File metadata
- Download URL: tksplashscreen-2.1-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dc7e671538cf9d2720b47b16075fcb9e877e92c0159022e2ec71244ddf6d9b5
|
|
| MD5 |
ff35e02b367994f5b089c94295a49a20
|
|
| BLAKE2b-256 |
aee71a2e3014538d8a325bcafa363d78eb5c214bac58a637e4374d097ec3c659
|