This release is a pre-release and may not be stable for production use.
Beta Release
Tkinter-devtools
Browser-like devtools but for Tkinter
Tired of restarting your tkinter app just to see the effect of every little change?
Inspired by browser devtools, Tkinter-devtools is a runtime inspector/editor for Tkinter apps that opens a developer window next to your running app so you can make live changes.
100% Python standard library. ZERO dependencies.
- Inspect the live widget tree structure
- Switch between widget option editing and geometry editing
- Add/update/remove widget configuration settings
- Highlight the currently selected widgets as you navigate
Install
pip install tkinter-devtools
Quick Start
Just pass your app or root window to the DevtoolsWindow constructor.
import tkinter as tk
from tkinter_devtools import DevtoolsWindow
# random set of test widgets
class TestApp(tk.Frame):
def __init__(self, root):
super().__init__(root)
grid_container = tk.Frame(self, padx=10, width=200, height=300)
tk.Label(self, text="Test App").grid(column=0, row=0)
tk.Button(self, text="Button").grid(column=0, row=2)
# Create a canvas widget
canvas = tk.Canvas(grid_container, width=400, height=300, bg='white')
canvas.pack()
# Draw a red rectangle
canvas.create_rectangle(50, 50, 200, 150, fill="red")
# Draw a blue oval
canvas.create_oval(250, 50, 350, 150, fill="blue")
canvas.create_window(50, 50)
grid_container.grid()
root = tk.Tk()
app = TestApp(root)
app.pack(side=tk.TOP, fill="both", expand=True)
DevtoolsWindow(app)
root.mainloop()
Options
DevtoolsWindow(master, **options) takes these optional keyword arguments.
| Option | Type | Default | Description |
|---|---|---|---|
devtools_title |
str |
'Tkinter-devtools' |
Title of the devtools window. |
show_unmapped_widgets |
bool |
True |
Show widgets in the tree that are not on screen, i.e. not packed. |
skip_runtime_checks |
bool |
None |
Skip the Tcl/Tk bridge checks on startup. See Runtime Safety Checks. |
logging_level |
int |
logging.ERROR |
Log level for devtools messages, e.g. logging.DEBUG. |
width |
int |
700 |
Width of the devtools window in pixels. |
height |
int |
500 |
Height of the devtools window in pixels. |
x_coord |
int |
700 |
Distance of the window from the left of the screen in pixels. |
y_coord |
int |
0 |
Distance of the window from the top of the screen in pixels. |
Runtime Safety Checks
Tkinter-devtools requires a stable Tcl/Tk bridge. On some systems this means tk.TclVersion <= 8.6. Modern Python upgraded to 9.0 and this will not work on some systems.
On startup, tests verify that the bridge is working. If it is not, the window will close and the devtools cannot run. You will need to patch your tcl version to 8.6 or another working version.
You can disable these checks with skip_runtime_checks=True.
To check your TclVersion:
python - <<'EOF'
import tkinter as tk
print("TclVersion:", tk.TclVersion)
print("TkVersion:", tk.TkVersion)
print("Tcl library:", tk._tkinter.__file__)
EOF
Build from source
git clone https://github.com/chrisdel101/tkinter-devtools.git
Installing package builder
Windows
py -m pip install --upgrade pip
py -m pip install --upgrade build
py -m build
Mac
python3 -m pip install --upgrade pip &&
python3 -m pip install --upgrade build &&
python3 -m build
Building the wheel
Packaging in source - run this in the tkinter-devtools directory. Removes any previous builds.
rm -rf build && rm -rf dist && rm -rf src/tkinter_devtools.egg-info && python -m build
Importing in local target - run this in the target application directory. Uninstalls previous first.
pip uninstall /path/to/package/tkinter_devtools/dist/tkinter_devtools-<current-version>-py3-none-any.whl && pip install /path/to/package/tkinter_devtools/dist/tkinter_devtools-<current-version>-py3-none-any.whl
Metadata
Release files for tkinter-devtools 0.0.1b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tkinter_devtools-0.0.1b1.tar.gz | 58.0 kB | Without provenance | Details for tkinter_devtools-0.0.1b1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tkinter_devtools-0.0.1b1-py3-none-any.whl | Python 3 | none | any | Details for tkinter_devtools-0.0.1b1-py3-none-any.whl |
Total release size: 107.9 kB
Release files / tkinter_devtools-0.0.1b1.tar.gz
| Download URL | tkinter_devtools-0.0.1b1.tar.gz |
|---|---|
| Size | 58.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d90fcc698b877fbd46ad57db57f87b8d022e760930e2ca11b7fa52bb5232ed71
|
|
BLAKE2b-256 checksum How to use checksums |
e26e2c47e8f954b0d9ef19d97aa0afdc1476dd160b76d8795882c8b0183ff5d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.2
|
Release files / tkinter_devtools-0.0.1b1-py3-none-any.whl
| Download URL | tkinter_devtools-0.0.1b1-py3-none-any.whl |
|---|---|
| Size | 49.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
61f80b74af21dcfd35f430bd4137501d2c78bca984cb00edeb0c2186dd9528bd
|
|
BLAKE2b-256 checksum How to use checksums |
b4ff84bfe0253b080d7a11f0c60f26618d7a596827add066b75bf3ea92c88d0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.2
|
Security for tkinter-devtools 0.0.1b1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.