Open In App

EasyGUI – Multiple Enter Box

Improve
Improve
Like Article
Like
Save
Share
Report

Multiple Enter Box : It is used to get the multiple input from the user at the single time, inputs can be any keyboard input, it takes inputs in form of string. It displays the title, message to be displayed, a group of places to enter a text and a pair of “Ok”, “Cancel” button which is used confirm the input. It is similar to normal enter box but in multiple enter box multiple inputs can be given at same time, below is how the enter box looks like

In order to do this we will use multenterbox method Syntax : multenterbox(message, title, list_items, lust_default_text) Argument : It takes 4 arguments, first string i.e message/information to be displayed, second string i.e title of the window, third is list of string i.e item name and forth is list of string which is default text Return : It returns the list of entered text and None if cancel is pressed

Example : In this we will create a multi enter box with default text, and will show the specific message on the screen according to the entered text, below is the implementation 

Python3




# importing easygui module
from easygui import *
 
# message to be displayed
text = "Enter the following details"
 
# window title
title = "Window Title GfG"
 
# list of multiple inputs
input_list = ["Name", "Class", "Section", "Address"]
 
# list of default text
default_list = ["eg GfG", "XII", "A", "GeeksforGeeks"]
 
# creating a integer box
output = multenterbox(text, title, input_list, default_list)
 
# title for the message box
title = "Message Box"
 
# creating a message
message = "Entered details are in form of list : " + str(output)
 
# creating a message box
msg = msgbox(message, title)


Output :

Another Example : In this we will create a multi enter box without default text, and will show the specific message on the screen according to the entered text, below is the implementation 

Python3




# importing easygui module
from easygui import *
 
# message to be displayed
text = "Enter the following details"
 
# window title
title = "Window Title GfG"
 
# list of multiple inputs
input_list = ["Geek Name", "Geek ID", "Experience"]
 
 
# creating a integer box
output = multenterbox(text, title, input_list)
 
# title for the message box
title = "Message Box"
 
# creating a message
message = "Entered details are in form of list : " + str(output)
 
# creating a message box
msg = msgbox(message, title)


Output :



Last Updated : 20 Sep, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads