EasyGUI – Multi Password Box
Last Updated :
10 Apr, 2023
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
from easygui import *
text = "Enter the details to go further"
title = "Window Title GfG"
fields = ["Email ID ", "Geek ID ", "Password"]
default_values = ["email@abc.com", "G - 111 ", "password"]
output = multipasswordbox(text, title, fields, default_values )
print ("Details entered by user")
print (" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ")
for i in range ( len (fields)):
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
from easygui import *
text = "Enter the details to go further"
title = "Window Title GfG"
fields = ["Email ID ", "Geek ID ", "Password"]
output = multipasswordbox(text, title, fields)
print ("Details entered by user")
print (" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ")
for i in range ( len (fields)):
print (fields[i] + " : " + str (output[i]))
|
Output :
Details entered by user
==================================
Email ID : aaa
Geek ID : Geek101
Password : alphabeta
Share your thoughts in the comments
Please Login to comment...