Easy GUI Python Tutorial: Learn Fast with Simple Examples

Logan Jul 13, 2026

Embarking on your Python journey? If user interaction is on your radar, EasyGUI is a must-learn. This simple yet powerful Python library allows you to create basic graphical user interfaces (GUIs) without needing to learn a separate GUI markup language. Let's dive into this easy and fun tutorial to get you started with EasyGUI in Python.

Game Development with Python Programming...
Game Development with Python Programming...

EasyGUI offers a range of functions to create basic windows with buttons, messages, input boxes, and even simple graphical elements like images. It's perfect for beginners or when you need a quick, no-nonsense way to interact with users.

Python Kivy Projects
Python Kivy Projects

Getting Started with EasyGUI

First, make sure you have EasyGUI installed. You can do this via pip, Python's package installer, by running: pip install easygui

the top 50 python project ideas
the top 50 python project ideas

Now, let's import the library in your Python script: import easygui

Displaying a Simple Message

Python Coding Practice | Easy Programming Logic
Python Coding Practice | Easy Programming Logic

One of the most basic functions is vrsta = easygui.msgbox('Hello, World!'). This will display a message box with the text 'Hello, World!' and an 'OK' button.

Try altering the text to see how this function works. The return value, in this case, is a message box identifier ('ok', 'cancel', or None), which you can store in a variable as shown above.

Asking for User Input

Python Notes for Beginners (Easy + Quick Guide)
Python Notes for Beginners (Easy + Quick Guide)

When you need user input, use username = easygui.enterbox('Please enter your username:'). This will display an input box asking for a username. The user's input is returned as a string.

You can set a default value with def_username = easygui.enterbox('Please enter your username:',默认值 = 'John Doe'). If the user presses 'OK' without changing the input, the default value will be returned.

Creating Interactive Dialogs

Tkinter Course - Create Graphic User Interfaces in Python Tutorial
Tkinter Course - Create Graphic User Interfaces in Python Tutorial

EasyGUI allows you to create more complex, multi-choice dialogue boxes with the easygui.ccbox() function, often used for questions or confirmation prompts.

For instance, easygui.ccbox('Are you sure you want to delete these records?', 'Confirm Deletion') will create a dialogue box with the message 'Are you sure you want to delete these records?' and two buttons - 'Yes' and 'No'. The returned value is a boolean: True for 'Yes' and False for 'No'.

All Important Python Functions for Beginners (Complete Cheat Sheet)
All Important Python Functions for Beginners (Complete Cheat Sheet)
Learn Python tkinter GUI progress bars easy 📊
Learn Python tkinter GUI progress bars easy 📊
an image of a computer screen with cats on it and the words, python list method
an image of a computer screen with cats on it and the words, python list method
the logo for pyot5 is shown in front of a black and green background
the logo for pyot5 is shown in front of a black and green background
Text-Based Adventure Game in Python (Complete Guide)
Text-Based Adventure Game in Python (Complete Guide)
9 Python Projects for Beginners (Build Your Portfolio Fast)
9 Python Projects for Beginners (Build Your Portfolio Fast)
30-Day Python Learning Plan for Beginners | Complete Python Roadmap to Learn Coding Fast
30-Day Python Learning Plan for Beginners | Complete Python Roadmap to Learn Coding Fast
Python to_timestamp Easiest Way to Implement with Examples
Python to_timestamp Easiest Way to Implement with Examples
Python Programming, Python
Python Programming, Python
How to Run a Python Script
How to Run a Python Script
Python Tutorial
Python Tutorial
30 Python Projects For Beginners and Advanced Learners (2023)
30 Python Projects For Beginners and Advanced Learners (2023)
Easy webscraper bot with Python!
Easy webscraper bot with Python!
Python Cheat Sheet for Beginners
Python Cheat Sheet for Beginners
Shortcut to learn Python.[Cheatsheet]
Shortcut to learn Python.[Cheatsheet]
Python Projects Ideas For Beginners
Python Projects Ideas For Beginners
Use a Drag & Drop Editor to Make Tkinter Python GUI Applications!
Use a Drag & Drop Editor to Make Tkinter Python GUI Applications!
Python Projects
Python Projects

Multichoice Dialogs

If you need a yes/no question with three or more options, use result = easygui.indexbox('Choose:', ['Option 1', 'Option 2', 'Option 3']). This will display a dropdown list with the given options.

The selected option's index (not the option itself) is returned. For example, if 'Option 2' is chosen and the options list is in the order [Option 1, Option 2, Option 3], '1' will be returned.

File Dialogs

EasyGUI also offers file dialogue functions like file_path = easygui.fileopenbox() for opening a file and file_path = easygui.filesavebox() for saving a file.

These return the chosen file's path. If the user presses 'Cancel', None is returned.

That's a wrap! Now that you've dived into the basics of EasyGUI, why not test your newfound skills by creating a simple interactive Python tool? The sky's the limit with your new user interface powers.