Python EasyGUI – Multi Choice Box
Multi Choice Box : It is used to display a window having a multiple options i.e items in EasyGUI, it can be used where there is a need to select multiple item among a group of items, it consist of title, message to be displayed, group of items and buttons i.e “Cancel”, “Select All”, “Clear All”, “Ok” buttons to confirm the selection of the item. It is similar to choice box but unlike choice box, in multi choice box we can select multiple items at a time. Below is how the choice box looks like

In order to do this we will use multchoicebox method
Syntax : multchoicebox(message, title, choices)
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 items
Return : It returns the list of display text of the selected items else None
Example :
In this we will create a multi choice box with multiple items, when any item is confirmed it will show the specific message on the screen according to the item, below is the implementation
Python3
# importing easygui modulefrom easygui import *# message to be displayedtext = "Selected any item from the list given below"# window titletitle = "Window Title GfG"# item choiceschoices = ["Geek", "Super Geeek", "Super Geek 2", "Super Geek God"]# creating a multi choice boxoutput = multchoicebox(text, title, choices)# title for the message boxtitle = "Message Box"# messagemessage = "Selected items : " + str(output)# creating a message boxmsg = msgbox(message, title) |
Output :

Another Example :
In this we will create a multi choice box without adding any item, when any item is confirmed it will show the specific message on the screen according to the item, below is the implementation
Python3
# importing easygui modulefrom easygui import *# message to be displayedtext = "Selected any item from the list given below"# window titletitle = "Window Title GfG"# creating a multi choice boxoutput = multchoicebox(text, title)# title for the message boxtitle = "Message Box"# messagemessage = "Selected items : " + str(output)# creating a message boxmsg = msgbox(message, title) |
Output :




