Password Box : It is used to get the input from the user which is in form of 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, place 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, below is how the password box looks like
In order to do this we will use
Syntax : passwordbox(message, title, default_text)
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 string which is default text
Return : It returns the entered text and None if cancel is pressed
In this we will create a password box with default text, and will show the specific message on the screen according to the entered text, below is the implementation
In this we will create a password box without default text, and will show the specific message on the screen according to the entered text, below is the implementation
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.