Skip to main content

TkEasyGUI is simple GUI Library for Python3 with Tkinter

Project description

TkEasyGUI - the easiest library for GUI

PyPI Downloads PyPI Version GitHub License

TkEasyGUI is the easiest library for creating GUIs in Python.

This library allows you to easily create GUI applications with Python. Since it is based on Tkinter, it runs consistently on Windows, macOS, and Linux. With a variety of built-in dialogs and customizable forms, you can develop applications effortlessly.

TkEasyGUI Screenshot

Platform

  • Windows / macOS / Linux (Tkinter required)

Install

Install package from PyPI.

pip install TkEasyGUI
# or
python -m pip install TkEasyGUI

Install package from GitHub Repository.

python -m pip install git+https://github.com/kujirahand/tkeasygui-python

Features of This Library

  • Python's standard UI library Tkinter, is often considered to have a high barrier to entry and to be difficult to use. By using this library, you can create GUI applications easily and intuitively.
  • This package supports type hints, allowing property selection via code completion. Python 3.9 or later is required.
  • In the event model, it is compatible with the well-known GUI library PySimpleGUI.
  • This project adopts the lenient MIT license. This license will not change in the future. Let's enjoy creating GUI programs.

How to use - popup dialogs

Using TkEasyGUI is simple. If you only want to display a dialog, it requires just two lines of code.

import TkEasyGUI as eg
# Show Text dialog
eg.print("A joyful heart is good medicine.")
TkEasyGUI

Ask the user for their name and display that name in the window.

import TkEasyGUI as eg
# Show Input dialog
name = eg.input("What is your name?")
eg.print(f"Hello, {name}.")
TkEasyGUI

Furthermore, a dialog is available that allows specifying multiple input fields.

import TkEasyGUI as eg
# Show Form dialog
form = eg.popup_get_form(["Name", "Age", "Hobbies"])
if form:
    name = form["Name"]
    age = form["Age"]
    hobbies = form["Hobbies"]
    eg.print(f"name={name}, age={age}, hobby={hobbies}")
TkEasyGUI

More Dialogs

TkEasyGUI provides a variety of dialogs. For example, a color selection dialog, a file selection dialog, and a calendar dialog.

How to use - widgets

To create a simple window with only labels and buttons, you would write as follows:

import TkEasyGUI as eg
# define layout
layout = [
    [eg.Text("Hello, World!")],
    [eg.Button("OK")]
]
# create a window
with eg.Window("Hello App", layout) as window:
    # event loop
    for event, values in window.event_iter():
        if event == "OK":
            eg.print("Thank you.")
            break

You can describe it using an event model similar to the famous GUI library, PySimpleGUI.

import TkEasyGUI as eg

# define layout
layout = [
    [eg.Text("Hello, World!")],
    [eg.Button("OK")]
]
# create a window
window = eg.Window("Hello App", layout)
# event loop
while True:
    event, values = window.read()
    if event in ["OK", eg.WINDOW_CLOSED]:
        eg.popup("Thank you.")
        break
# close window
window.close()

Samples

We have prepared a selection of samples to demonstrate simple usage. Please check them out.

Running tests/file_viewer.py allows all samples to be easily launched.

Documents

Below is a detailed list of classes and methods.

Tutorial

Japanese tutorials:

There are other helpful articles as well.

Compatibility with PySimpleGUI

  • When using basic functionalities, it is compatible with PySimpleGUI. Programs can be written using the same event-driven model as PySimpleGUI.
  • The names of basic GUI components are kept the same, but some property names differ.
  • TkEasyGUI has been completely reimplemented from scratch and is licensed under the MIT License.
  • However, full compatibility with PySimpleGUI is not intended.

TkEasyGUI features

  • Using a for loop and window.event_iter() enables straightforward event processing.
  • Custom popup dialogs, such as a color selection dialog(eg.popup_color), a list dialog(eg.popup_listbox), form dialog(eg.popup_get_form) are available.
  • The Image class supports not only PNG but also JPEG formats.
  • Convenient event hooks and features for bulk event registration are provided - docs/custom_events.
  • Methods such as Copy, Paste, and Cut are added to text boxes (Multiline/Input).
  • The system's default color scheme is utilized.
TkEasyGUI Logo

Additional Information

How to run on Raspberry Pi?

It works on Raspberry Pi OS as well. Please pay attention to the following points during installation:

  • Use Python 3.9 or higher.
  • Pillow (not PIL) is required. Please run the following command:
    • pip install --upgrade --force-reinstall pillow
    • If this does not work, uninstall the old system version of Pillow and reinstall it:
      • sudo apt remove python3-pil
      • pip install pillow
  • Tkinter is pre-installed on Raspberry Pi, but the python3-tk package is required. Please run the following command:
    • sudo apt-get install python3-tk

Link

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

tkeasygui-1.0.41.tar.gz (66.7 kB view details)

Uploaded Source

Built Distribution

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

tkeasygui-1.0.41-py3-none-any.whl (64.9 kB view details)

Uploaded Python 3

File details

Details for the file tkeasygui-1.0.41.tar.gz.

File metadata

  • Download URL: tkeasygui-1.0.41.tar.gz
  • Upload date:
  • Size: 66.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for tkeasygui-1.0.41.tar.gz
Algorithm Hash digest
SHA256 d969fd72b3b1472ccec4ad5e66cdd86e42650d48731f135f41e8a985293c7db5
MD5 ce7d114c08a228b93161e89fe3d51073
BLAKE2b-256 8e430b670b9a1ebdb169a09546502b084fd2d06eb793ce5506308f5dcd9c63a2

See more details on using hashes here.

File details

Details for the file tkeasygui-1.0.41-py3-none-any.whl.

File metadata

  • Download URL: tkeasygui-1.0.41-py3-none-any.whl
  • Upload date:
  • Size: 64.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for tkeasygui-1.0.41-py3-none-any.whl
Algorithm Hash digest
SHA256 c15c423ac877e2a1953b9ad8eb3b1fe7a63b9e372f4ee64b470eb3fbff96b86d
MD5 053318a44b2ce8e56add2a82c771bcae
BLAKE2b-256 74059a1452dfbd46169af6d2e8b2c5c4b3fefa71e52934bf569441540b4f7e2c

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