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.
Button Box : It is used to display a window having multiple buttons in EasyGUI, it can be used where there is condition to select one among lot of buttons for example buttons in lift at a time user can opt only one option, below is how the normal button box looks like
In order to do this we will use
Syntax : buttonbox(text, title, button_list)
Argument : It takes 3 arguments, first string i.e text to be displayed, second string i.e title of the window and third list of button(strings)
Return : It returns the text of the button that the user selected
In this we will create a button box windows having a three buttons which user can select and selected button text will get printed, below is the implementation
User selected option : Second
Another example :
User selected option : Button
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course