Skip to main content
Pre-release

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.1b0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tkinter-devtools 0.0.1b0
File Size Uploaded Provenance Actions
tkinter_devtools-0.0.1b0.tar.gz 58.2 kB Without provenance Details for tkinter_devtools-0.0.1b0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tkinter-devtools 0.0.1b0
File Interpreter ABI Platform Actions
tkinter_devtools-0.0.1b0-py3-none-any.whl Python 3 none any Details for tkinter_devtools-0.0.1b0-py3-none-any.whl

Total release size: 107.9 kB

Release files / tkinter_devtools-0.0.1b0.tar.gz

Download URL tkinter_devtools-0.0.1b0.tar.gz
Size 58.2 kB
Tags Source
SHA-256 checksum
How to use checksums
88827dcb42b1c59c6d370a6aa3bc3a5042051476a0a4ff7c056a26757a2e748f
BLAKE2b-256 checksum
How to use checksums
240e356893b5b8c7313c164e1ff7911c47116199fedc88399c11840dca0aaedf
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.1b0-py3-none-any.whl

Download URL tkinter_devtools-0.0.1b0-py3-none-any.whl
Size 49.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
346f105ac7908767e4338be1e4fd0a5f887ad4030a9b428506dd59d81dcb4389
BLAKE2b-256 checksum
How to use checksums
480f3cc81607431cfc066729c9dedad4c521233c2ca2e80746954871034dd681
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.1b0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page