Python EasyGUI - Button Box Last Updated : 05 Sep, 2020 Comments Improve Suggest changes Like Article Like Report 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 buttonbox method 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 Example : 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 Python3 1== # importing easygui module from easygui import * # message to be displayed text = "Message to be displayed on the window GfG" # window title title = "Window Title GfG" # button list button_list = [] # button 1 button1 = "First" # second button button2 = "Second" # third button button3 = "Third" # appending button to the button list button_list.append(button1) button_list.append(button2) button_list.append(button3) # creating a button box output = buttonbox(text, title, button_list) # printing the button pressed by the user print("User selected option : ", end = " ") print(output) Output : User selected option : Second Another example : Python3 1== # importing easygui module from easygui import * # message to be displayed text = "Message to be displayed on the window GfG" # window title title = "Window Title GfG" # creating a button box output = buttonbox(text, title) # printing the button pressed by the user print("User selected option : ", end = " ") print(output) Output : User selected option : Button[3] Comment More infoAdvertise with us Next Article Python EasyGUI - Button Box R rakshitarora Follow Improve Article Tags : Python Python-gui Python-EasyGUI Practice Tags : python Similar Reads Python EasyGUI â Boolean Box Boolean Box : It is used to display a window having a multiple options i.e buttons in EasyGUI, it can be used where there is a need to get if the first selection option as it returns 1 for button having index 0 and for other button it returns 0, it is slightly different from index box, below is how 3 min read Python EasyGUI â Enter Box Enter Box : It is used to get the input from the user, input can be any keyboard input, it takes input in form of string. It displays the title, message to be displayed, place to enter a text and a pair of "Ok", "Cancel" button which is used confirm the input. Also we can set some default text to th 2 min read Python EasyGUI â Showing Image in a Button Box In this article we will see how we can add or show image in the button box. Button box 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 3 min read Python EasyGUI â Yes No Box Yes No Box : It is used to display a window having a two option yes or no in EasyGUI, it can be used where there is a need to get the answer of the question in form of yes or no, it displays two option yes or no for example when we want to ask user whether he is above 18 or not we will use yes no bo 3 min read Python EasyGUI - Message Box Message Box : It is used to display a window having a message or information in EasyGUI, it can be used where there is a need to display some message or some important information, it contains message and a "Ok" button which when pressed closes the message, below is how the message box looks like 2 min read Like