EasyGUI

0.98.3 · maintenance · verified Fri Apr 10

EasyGUI is a module for very simple, very easy GUI programming in Python. It differentiates from other GUI libraries by not being event-driven; instead, all GUI interactions are invoked by simple blocking function calls. The current version is 0.98.3, released on April 1, 2022, with an infrequent release cadence.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates basic EasyGUI interactions: displaying a message box, asking a yes/no question, and getting text input from the user. EasyGUI functions are blocking, meaning the program waits for user interaction before proceeding. Remember to run EasyGUI scripts outside of IDLE for best compatibility.

import easygui as eg
import sys

# Display a simple message box
eg.msgbox("Hello from EasyGUI!", "Welcome")

# Ask a yes/no question
if eg.ynbox("Shall I continue?", "Question"): 
    # If user chose Yes, ask for input
    name = eg.enterbox("What is your name?", "Name Input")
    if name:
        eg.msgbox(f"Hello, {name}!", "Greeting")
    else:
        eg.msgbox("You cancelled the name input.", "Cancelled")
else:
    eg.msgbox("You chose to exit.", "Exit")
    sys.exit(0)

view raw JSON →