EasyGUI – Multiple Enter Box
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
from easygui import *
text = "Enter the following details"
title = "Window Title GfG"
input_list = ["Name", "Class", "Section", "Address"]
default_list = ["eg GfG", "XII", "A", "GeeksforGeeks"]
output = multenterbox(text, title, input_list, default_list)
title = "Message Box"
message = "Entered details are in form of list : " + str (output)
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
from easygui import *
text = "Enter the following details"
title = "Window Title GfG"
input_list = ["Geek Name", "Geek ID ", "Experience"]
output = multenterbox(text, title, input_list)
title = "Message Box"
message = "Entered details are in form of list : " + str (output)
msg = msgbox(message, title)
|
Output :
Last Updated :
20 Sep, 2022
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...