EasyGUI – Multi Password Box

Multi Password Box : It is used to get the input from the user which is in form of multiple text and single password i.e masked input, input can be any keyboard input, it takes input in form of string. It displays the title, message to be displayed, group of places 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 the place where user enter text. It is similar to multi enter box but last entry field is considered as password i.e masked text below is how the password box looks like
In order to do this we will use multpasswordbox method Syntax : multpasswordbox(message, title, fields, 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 fields 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 password 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 modulefrom easygui import *# message to be displayedtext = "Enter the details to go further"# window titletitle = "Window Title GfG"# list of entry fieldsfields = ["Email ID", "Geek ID", "Password"]# default textdefault_values = ["email@abc.com", "G-111", "password"]# creating a multi password boxoutput = multipasswordbox(text, title, fields, default_values )# showing details entered by the userprint("Details entered by user")print("==================================")# traversing the outputfor i in range(len(fields)): # showing field and entered value print(fields[i] + " : " + str(output[i])) |
Output :
Details entered by user ================================== Email ID : email@asd.ccc Geek ID : G-11122 Password : password
Another Example : In this we will create a multi password 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 modulefrom easygui import *# message to be displayedtext = "Enter the details to go further"# window titletitle = "Window Title GfG"# list of entry fieldsfields = ["Email ID", "Geek ID", "Password"]# creating a multi password boxoutput = multipasswordbox(text, title, fields)# showing details entered by the userprint("Details entered by user")print("==================================")# traversing the outputfor i in range(len(fields)): # showing field and entered value print(fields[i] + " : " + str(output[i])) |
Output :
Details entered by user ================================== Email ID : aaa Geek ID : Geek101 Password : alphabeta




