graphical user interface (GUI)

A graphical user interface (GUI) is a visual way of interacting with a program through windows, buttons, menus, and other on-screen elements. Instead of typing text commands in a terminal, users interact through actions like clicking, dragging, dropping, and scrolling. Most desktop and mobile applications use GUIs.

In Python, the standard library includes tkinter for building GUIs with basic widgets like labels, buttons, text fields, and drop-down menus.

For more complex applications, third-party libraries like PyQt and PySide provide richer widget sets and tools, such as a visual form designer.

Unlike a command-line interface (CLI), a GUI doesn’t require users to memorize commands, but it typically takes more code to build.

Example

A minimal GUI app built with tkinter:

Python
import tkinter as tk

root = tk.Tk()
root.title("Greeting")

label = tk.Label(root, text="Hello, Pythonista!")
label.pack(padx=20, pady=20)

root.mainloop()

Running this script opens a small window that displays the text “Hello, Pythonista!”

Tutorial

Python GUI Programming: Your Tkinter Tutorial

Complete an interactive tutorial for Python's GUI library Tkinter. Add buttons, text boxes, widgets, event handlers, and more while building two GUI apps.

basics gui stdlib

For additional information on related topics, take a look at the following resources:


By Dan Bader • Updated Feb. 19, 2026 • Reviewed by Leodanis Pozo Ramos