Skip to main content

A hot reload implementation for Tkinter applications

Project description

TkinterHotReload

A powerful hot reload utility for Tkinter applications that enables real-time code updates without restarting your application.

Features

  • 🔄 Live code reloading for Tkinter applications
  • 🚀 Zero configuration required
  • 🎯 Automatic detection of file changes
  • 💻 Seamless development experience
  • 🛠 Maintains application state during reloads

Installation

Install TkinterHotReload using pip:

pip install tkhr --upgrade

Quick Start

Here's a simple example of how to use TkinterHotReload:

import tkhotreload as tkhr
from tkinter import Label, Button


def main(root: tkhr.TkinterHotReload):
    # Use the new properties method to set multiple attributes at once
    root.properties(
        title="Tk Inter Reload",
        always_on_top=True,
        alpha=0.5,
        icon="icon.ico",
        debug=False,
    )
    Label(root, text="Change this and save!").pack(pady=20)
    Button(root, text="Click me", command=lambda: print("Clicked!")).pack()


tkhr.app(target=main, watch_dir=".", exclude=["*.pyc", "__pycache__"])

How It Works

TkinterHotReload monitors your Python files for changes. When you modify and save a file, it automatically:

  1. Detects the changes in your code
  2. Reloads the modified modules
  3. Updates your Tkinter application while preserving its state

Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions, please:

  • Open an issue on GitHub
  • Check existing issues for solutions
  • Provide detailed information about your problem

Acknowledgments

  • Thanks to all contributors who have helped shape TkinterHotReload
  • Inspired by hot reload functionality in modern web development

Made with ❤️ for the Python community

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

tkhr-0.1.2.tar.gz (41.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tkhr-0.1.2-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file tkhr-0.1.2.tar.gz.

File metadata

  • Download URL: tkhr-0.1.2.tar.gz
  • Upload date:
  • Size: 41.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for tkhr-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1b3dba1c17652e6ff0345047a8ac60d95d819c791c5ace4e3b964376a3f32a69
MD5 797d95097d98d35f86450e855b2e263e
BLAKE2b-256 ac1ac6e810ae8ff2b3958e9d4412825e344f61e5eb325952e2982f19d48d8560

See more details on using hashes here.

File details

Details for the file tkhr-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tkhr-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for tkhr-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2a08c1fdbc7bae67ebb2cb097c018d5f73c6de9f84d88a31eb8a06a29d57785e
MD5 acd3fcd34e45bf9a4e0cb72c98170d71
BLAKE2b-256 261209d825c4d69d19ddd056bfa1bbc0d11665296afb4aa54020f7f2ef685b20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page