Open In App
Related Articles

Python EasyGUI module – Introduction

Improve Article
Save Article
Like Article

EasyGUI is a module for very simple, very easy GUI programming in Python. EasyGUI is different from other GUI generators in that EasyGUI is NOT event-driven. Instead, all GUI interactions are invoked by simple function calls. Unlike other complicated GUI’s EasyGUI is the simplest GUI till now.

Install using this command: 

pip install easygui

Note : It is not recommended to run EasyGui on IDLE as EasyGui runs on Tkinter and has its own event loop, and IDLE is also an application written by Tkinter module and also it has its own event loop. So when both are run at the same time, conflicts can occur and unpredictable results can occur. So it is preferred to run EasyGui out side the IDLE.

Importing EasyGUI  

from easygui import *

It is the best way to use all the widgets without extra reference.

Example : 
In this we will create a window having a short message and a press button which when pressed closes our message box, below is the implementation 


# importing easygui module
from easygui import *
# title of our window
title = "GfG-EasyGUI"
# message for our window
msg = "GeeksforGeeks, Hello World from EasyGUI"
# button message by default it is "OK"
button = "Let's Go"
# creating a message box
msgbox(msg, title, button )

Output : 

"Let's Go"

Another Example: 
In this we will allow user to choose the “geek form” and when ans is selected it will get printed, below is the implementation 


# importing easygui module
from easygui import *
# choices which user can select
choices = ["Geek", "Super Geek", "Super Geek 2", "Super Geek God"]
# message / question to be asked
msg = "Select any one option"
# opening a choice box using our msg and choices
reply = choicebox(msg, choices = choices)
# printing the selected option
print("You selected : ", end = "")

Output : 

You selected : Super Geek God


Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 09 Jun, 2021
Like Article
Save Article
Similar Reads
Complete Tutorials