tkinter
- Version:
3.11.3
- Category:
lang
- Cluster:
Vali
Description
Tkinter is the standard GUI library for Python. It provides a fast and native-looking interface for building windowed applications on Linux, Windows, and macOS.
This module provides Tkinter bindings for Python 3.11.3, compiled using GCCcore 12.3.0, and is typically used for:
Building desktop tools and small graphical apps
Teaching basic GUI development
Rapid prototyping with visual interfaces
Tkinter wraps the Tcl/Tk GUI toolkit and is lightweight, portable, and beginner-friendly.
Documentation
>>> import tkinter
>>> help(tkinter) Common Widgets: Button, Canvas, Entry, Frame, Label, Listbox, Menu, Message,
Radiobutton, Scale, Scrollbar, Text, Toplevel
Key Functions:
tkinter.Tk() Create a main window tkinter.Label() Add a label widget
tkinter.Button() Add a button widget
widget.pack() Add widget to layout
mainloop() Run the GUI event loop
Example:
>>> import tkinter as tk
>>> win = tk.Tk()
>>> tk.Label(win, text="Hello, world!").pack()
>>> win.mainloop()
Examples/Usage
Load the module:
$ module load lang/Tkinter/3.11.3-GCCcore-12.3.0
Run a basic GUI test:
import tkinter as tk
root = tk.Tk()
tk.Label(root, text="Tkinter GUI works!").pack()
root.mainloop()
Use with IDEs or scripts that call graphical widgets (e.g., matplotlib with TkAgg backend)
Unload the module:
$ module unload lang/Tkinter/3.11.3-GCCcore-12.3.0
Installation
Source code is obtained from Python