Skip to main content

TkEasyGUI - the easiest library for GUI

PyPI Downloads PyPI Version GitHub License

TkEasyGUI is the easiest library for creating GUIs in Python.

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.

# Install package from PyPI
pip install TkEasyGUI
# or
python -m pip install TkEasyGUI

Install package from GitHub Repository.

# Install package from GitHub Repository
python -m pip install git+https://github.com/kujirahand/tkeasygui-python
# or
# Clone the repository and install
git clone https://github.com/kujirahand/tkeasygui-python
cd tkeasygui-python
python -m pip install .

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

A file selection dialog is also available.

import TkEasyGUI as eg
# Show File dialog
file_path = eg.popup_get_file("Select a file")
eg.print(f"You selected: {file_path}")
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.

Development and Testing

This project uses Just as a task runner. You can run various development tasks (formatting, linting, testing, etc.) by installing just and running:

just

To run the automated tests located in pytest_tests, install pytest and run:

python -m pip install -U pytest
just test

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.

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

Metadata

Release files for TkEasyGUI 1.0.45

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

Source distribution (sdist)

Source distribution for TkEasyGUI 1.0.45
File Size Uploaded
tkeasygui-1.0.45.tar.gz 68.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for TkEasyGUI 1.0.45
File Interpreter ABI Platform
tkeasygui-1.0.45-py3-none-any.whl Python 3 none any Details

Total release size: 135.4 kB

Release files / tkeasygui-1.0.45.tar.gz

Download URL tkeasygui-1.0.45.tar.gz
Size 68.8 kB
Tags Source
SHA-256 checksum
How to use checksums
aa959d2ef11477e48ee62116dca47328151452bece2355cfa84819456f68be72
BLAKE2b-256 checksum
How to use checksums
d62e5eef0001187a69b661b0e0faf7aaf02d32046447ac1468e2f3e6d292499e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / tkeasygui-1.0.45-py3-none-any.whl

Download URL tkeasygui-1.0.45-py3-none-any.whl
Size 66.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26cfbcdd8be181f6474c128dc121a9b8a2ed7413df9da85dd2c8aa7b41f5b592
BLAKE2b-256 checksum
How to use checksums
94063fde1f51821bb3917878accbecb371c062b1e52d15da474606c6bad19709
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

1.0.45 This release

2 release files

1.0.44

2 release files

1.0.43

2 release files

1.0.42

2 release files

1.0.41

2 release files

1.0.38

2 release files

1.0.37

2 release files

1.0.36

2 release files

1.0.35

2 release files

1.0.32

2 release files

1.0.26

2 release files

1.0.25

2 release files

1.0.24

2 release files

1.0.23

2 release files

1.0.22

2 release files

1.0.21

2 release files

1.0.20

2 release files

1.0.18

2 release files

1.0.17

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

0.2.75

2 release files

0.2.74

2 release files

0.2.73

2 release files

0.2.71

2 release files

0.2.69

2 release files

0.2.68

2 release files

0.2.67

2 release files

0.2.63

2 release files

0.2.57

2 release files

0.2.55

2 release files

0.2.49

2 release files

0.2.48

2 release files

0.2.47

2 release files

0.2.46

2 release files

0.2.45

2 release files

0.2.44

2 release files

0.2.31

2 release files

0.2.30

2 release files

0.2.29

2 release files

0.2.28

2 release files

0.2.27

2 release files

0.2.24

2 release files

0.2.20

2 release files

0.2.19

2 release files

0.2.16

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.6

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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