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_0button_1entry_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 labellabel_number(int): Row index and unique IDfg(str): Text colorbg(str): Background colorlabel_width(int): Width of labellabel_height(int): Height of label
Conditions
label_numbermust be unique
Returns
tk.Labelobject
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 textbutton_number(int): Row index and IDbutton_command(callable): Function executed on clickfg(str): Text colorbg(str): Background colorbutton_width(int): Widthbutton_height(int): Height
Conditions
button_commandmust be a function orNone
Returns
tk.Buttonobject
3. make_entry
def make_entry(self, entry_number=0, entry_width=30,
fg="black", bg="white"):
Parameters
entry_number(int): Row index and IDentry_width(int): Width of entryfg(str): Text colorbg(str): Background color
Returns
tk.Entryobject
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
ValueErrorif entry does not existTypeErrorif widget is not an Entry
Returns
str
5. delete_widget
def delete_widget(self, widget_number, widget_type):
Parameters
widget_number(int): Widget IDwidget_type(str):label,button, orentry
Conditions
- Widget must exist in dictionary
Errors
ValueErrorif 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)
| 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
|