Skip to main content

TkEasyGUI is simple GUI Library for Python3 with Tkinter

Project description

TkEasyGUI

TkEasyGUI is the easiest library for creating GUIs in Python.

TkEasyGUI Logo
  • 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.

  • In the event model, it is compatible with the well-known GUI library PySimpleGUI.

  • This package supports type hints, allowing property selection via code completion. Python 3.9 or later is required.

  • This project adopts the lenient MIT license. This license will not change in the future. Let's enjoy creating GUI programs.

  • 👉日本語 / 👉中文

Platform

  • Windows / macOS / Linux (Tkinter required)
TkEasyGUI

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
  • (memo) Updating from older versions (less than 0.2.24) will fail. (See the solution)

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
# Displays the message in a popup dialog.
eg.print("A joyful heart is good medicine.")

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

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

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

import TkEasyGUI as eg
m = eg.popup_get_form(["Name", ["Age", "number"]])
if m:
    name = m["Name"]
    age = m["Age"]
    eg.print(f"name={name}, age={age}") # name=kujira, age=20.0

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:

About the relationship with PySimpleGUI

  • When utilizing basic features, it is compatible with PySimpleGUI. You can write programs using the same event model as PySimpleGUI.
  • The names of basic GUI components are also kept the same. However, while some property names differ, many unique features have been implemented.
  • This project was developed with PySimpleGUI in mind, but has been implemented entirely from scratch. There are no licensing issues.
  • We are not considering full compatibility with PySimpleGUI.

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), 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.

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.6.tar.gz (44.9 kB view details)

Uploaded Source

Built Distribution

TkEasyGUI-1.0.6-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tkeasygui-1.0.6.tar.gz
  • Upload date:
  • Size: 44.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.7

File hashes

Hashes for tkeasygui-1.0.6.tar.gz
Algorithm Hash digest
SHA256 a5707ebe418b9a2ade4f4f79c03ed9803802fa0e225a968627c5febe4a8e389b
MD5 7e4c813acd7113e800624655407e176e
BLAKE2b-256 55121a3f0c65077906ae79c70e90dc5d65485e9bab975fbe9bb00768842ca354

See more details on using hashes here.

File details

Details for the file TkEasyGUI-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: TkEasyGUI-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.7

File hashes

Hashes for TkEasyGUI-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e10c05fadd3ab4eba559a382926c738debe3da098a07f4d3411b4356adbc45b4
MD5 6e5a6c0b1be291bf790ff882be626684
BLAKE2b-256 67e78037e945b2277e138aef04e00e05f381fb5fa9d74b0ae53d5856f4555e85

See more details on using hashes here.

Supported by

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