Python EasyGUI – Boolean Box Last Updated : 23 Dec, 2021 Comments Improve Suggest changes Like Article Like Report 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 the boolean box looks like In order to do this we will use boolbox methodSyntax : boolbox(message, title, buttons)Argument : It takes 3 arguments, first string i.e message/information to be displayed, second string i.e title of the window and third is list of strings i.e buttons exactly having two buttonsReturn : It returns return 1 if first button is pressed else 0 for other buttons selected by the user Example : In this we will create a index box, when any button is pressed it will show the specific message on the screen according to the index, below is the implementation Python3 # importing easygui module from easygui import * # message / information to be displayed on the screen message = "Select any one button" # title of the window title = "GfG - EasyGUI" # creating a index box output = boolbox(message, title) # showing new message according to the buttons pressed # if output is 1 if output == 1: # message / information message = "First Button is pressed" # if output is 0 elif output == 0: # message / information message = "Button rather than first button is pressed" # title of the window title = "GfG - EasyGUI" # creating a message box msg = msgbox(message, title) Output : Another Example : In this we will create a index box with added buttons, when any button is pressed it will show the specific message on the screen according to the index, below is the implementation Python3 # importing easygui module from easygui import * # message / information to be displayed on the screen message = "Select any one button" # title of the window title = "GfG - EasyGUI" # buttons buttons = ["First", "Second"] # creating a boolean box output = boolbox(message, title, buttons) # showing new message according to the buttons pressed # if output is 1 if output == 1: # message / information message = "First Button is pressed" # if output is 0 elif output == 0: # message / information message = "Button rather than first button is pressed" # title of the window title = "GfG - EasyGUI" # creating a message box msg = msgbox(message, title) Output : Comment More infoAdvertise with us Next Article Python EasyGUI – Boolean Box R rakshitarora Follow Improve Article Tags : Python Python-gui Python-EasyGUI Practice Tags : python Similar Reads 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 â 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 â Continue Cancel Box Continue Cancel Box : It is used to display a window having a two option continue or cancel in EasyGUI, it can be used where there is a need to display two option continue or cancel for example when we want to confirm the option if continue is pressed application will move forward else it will get t 3 min read Python Boolean Python Boolean type is one of the built-in data types provided by Python, which represents one of the two values i.e. True or False. Generally, it is used to represent the truth values of the expressions.Python Boolean TypeBoolean value can be of two types only i.e. either True or False. The output 7 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