Skip to main content

HumblyTkinter Library Documentation

Library name: humblytkinter Author: Mohammad Parsa Abdi (محمدپارسا عبدی)


Introduction

humblytkinter is a simple Python library built on top of the standard tkinter module. The goal of this library is to make GUI creation easier and cleaner for beginners by providing ready-to-use methods for common widgets such as labels, buttons, and entries.

This documentation explains all classes, functions, parameters, conditions, and usage rules of the library in detail.

All code examples are written in English, Left-to-Right (LTR), and are safe to copy and use directly.


Installation

Place the humblytkinter folder in your project or install it locally, then import it:

from humblytkinter import MyGUI

Main Class

MyGUI

This is the core class of the library. It manages the window, widgets, and execution of the GUI.

class MyGUI:

Constructor

def __init__(self, window_name="My Window"):

Parameters

  • window_name (str): The title of the application window.

What it does

  • Creates the main Tkinter window
  • Sets the window title
  • Initializes an internal dictionary to track widgets

Widgets Storage System

The library stores all widgets in a dictionary:

self.widgets = {}

Each widget is saved with a unique key such as:

  • label_0
  • button_1
  • entry_2

This allows safe deletion, access, and validation.


Functions (Methods)

1. make_label

def make_label(self, label_text="Hello World", label_number=0,
               fg="black", bg="white", label_width=30, label_height=2):

Parameters

  • label_text (str): Text shown on the label
  • label_number (int): Row index and unique ID
  • fg (str): Text color
  • bg (str): Background color
  • label_width (int): Width of label
  • label_height (int): Height of label

Conditions

  • label_number must be unique

Returns

  • tk.Label object

2. make_button

def make_button(self, button_text="Click", button_number=0,
                button_command=None, fg="black", bg="lightgray",
                button_width=30, button_height=2):

Parameters

  • button_text (str): Button text
  • button_number (int): Row index and ID
  • button_command (callable): Function executed on click
  • fg (str): Text color
  • bg (str): Background color
  • button_width (int): Width
  • button_height (int): Height

Conditions

  • button_command must be a function or None

Returns

  • tk.Button object

3. make_entry

def make_entry(self, entry_number=0, entry_width=30,
               fg="black", bg="white"):

Parameters

  • entry_number (int): Row index and ID
  • entry_width (int): Width of entry
  • fg (str): Text color
  • bg (str): Background color

Returns

  • tk.Entry object

4. get_output

def get_output(self, entry_number=0):

What it does

  • Retrieves text from a specific Entry widget

Conditions

  • Entry must exist
  • Widget must be of type tk.Entry

Errors

  • ValueError if entry does not exist
  • TypeError if widget is not an Entry

Returns

  • str

5. delete_widget

def delete_widget(self, widget_number, widget_type):

Parameters

  • widget_number (int): Widget ID
  • widget_type (str): label, button, or entry

Conditions

  • Widget must exist in dictionary

Errors

  • ValueError if widget not found

6. delete_all

def delete_all(self):

What it does

  • Destroys all widgets
  • Clears widget storage

7. run

def run(self):

What it does

  • Starts the Tkinter main loop
  • Keeps the window running

Full Example

from humblytkinter import MyGUI

def show_text():
    text = app.get_output(0)
    print(text)

app = MyGUI("HumblyTkinter Demo")

app.make_label("Enter your name", 0)
app.make_entry(1)
app.make_button("Submit", 2, show_text)

app.run()

Design Goals

  • Beginner-friendly
  • Minimal syntax
  • Clean structure
  • Safe widget management

License & Credits

Created by Mohammad Parsa Abdi Library name: humblytkinter

You are free to use and modify this library for educational projects.

Metadata

Release files for hutk 3.0

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

Source distribution (sdist)

Source distribution for hutk 3.0
File Size Uploaded
hutk-3.0.tar.gz 4.5 kB Details

Release files / hutk-3.0.tar.gz

Download URL hutk-3.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bb7d81a8c88acdf5bbf80d83f74ea0972fe08d8ab69ff5b6753946a92b57c2b4
BLAKE2b-256 checksum
How to use checksums
f5d71b06ac4add97e171692f34045ac837df0f1207a2753df088bf783e18a6d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

3.0 This release

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

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