Skip to main content

A package with some helpful tkinter functions

Project description

TKinter-Kit ⏱️

This project aims to provide a rich set of helpful functions, to easily use the tkinter module, to have a better graphical user interface experience

Features 💡

  • It contains functions to easily interact with users as simple as the print() and input() functions
  • It helps to manage scroll_bar easily
  • It helps to have a better experience when printing 2D tables

Examples of use 📝

#!/usr/bin/env python3
# -*-coding:UTF-8 -*

import tkinter as tk
import tkinter_kit.func as tkk

# We create a main window
window = tk.Tk(className=" Test of tkinter_kit")

# We create a canvas and a frame to add a vertical scrollbar
canvas = tk.Canvas(window, width = 1000, height=830)
frame = tk.LabelFrame(canvas, width=1000, height=830, text="Test of tkinter_kit")
scrollbar = tkk.frame_vertical_scrollbar(window, canvas, frame)

# We create a label to display a message
tkk.print_window(frame, "Welcome to the test of tkinter_kit")

# We create an entry to ask the user's name
name = tkk.input_window(window, frame, "What is your name?")

# We create a label to display the user's name
tkk.print_window(frame, "Hello, " + name)

tkk.next_button(window, frame, text="Next")

# We create a list of data to display a table
Heading = ["Name", "Age", "City"]
Datas = [["Alice", 25, "Paris"], ["Bob", 30, "Lyon"], ["Charlie", 35, "Marseille"]]

# We create a label to display the title of the table
tkk.print_window(frame, "Here is a table of data")

# We create a table to display the data
tkk.print_table_windows(frame, Heading, Datas)

# We create a list of possible answers
RESPONSES = ["Yes", "No", "Maybe"]

# We create a label to display a question
tkk.print_window(frame, "Do you like Python?")

# We create radio buttons to display the possible answers
value = tk.StringVar()
button1 = tk.Radiobutton(frame, text="Yes", variable=value, value=RESPONSES[0])
button2 = tk.Radiobutton(frame, text="No", variable=value, value=RESPONSES[1])
button3 = tk.Radiobutton(frame, text="Maybe", variable=value, value=RESPONSES[2])
button1.pack()
button2.pack()
button3.pack()

# We create a button to validate the answer
tkk.next_button(window, frame, text="Validate")

# We create a label to display the user's answer
tkk.print_window(frame, "You answered: " + value.get())

# We create a button to quit the window
tkk.leave_window(window, frame, text="Quit")

We obtain this result :

test_tkinter_kit

Author ✍️

This project was created by KpihX. You can contact me at kapoivha@gmail.com for any questions or suggestions.

License 📄

This project is licensed under the MIT license - see the LICENSE file for more details.

: https://github.com/KpihX

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

tkinter_kit-0.0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file tkinter_kit-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: tkinter_kit-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for tkinter_kit-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3749992b3bf0fe161a436fe044cb6bae3ff31008feef4bed9f05160e4dc642f3
MD5 2d604a8e6c19ecc0c3a7d5258161ac82
BLAKE2b-256 fe86518c1be70276da078335461597223e72084d750aaf37cb51cbd725d51838

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