I am new in the world of python. I created a simple program in which I added username and password entry ( no GUI) by using "if else" conditional expression. When i write username in program it appear as simple text but it’s ok but when I write password it also appear as simple text. I want to write password in the form of ‘*’ like all login prompts. password => ***** ?????????.
usr = (str(input(‘USERNAME : ‘)))
if usr == ‘python’:password = (str(input(‘PASSWORD : ‘)))
if password == ‘root’:print (‘login succesfull’)
else:print (‘wrong password’)
else:print (‘wrong username’)
There is getpass(), a function which hides the user input.
password = getpass.getpass()
mypass = getpass.getpass("PASSWORD : ")