I am trying to make a small program which checks the strength of the user password. When the user is prompted to enter their password I want the input to show as asterisks or dots instead of the text input. Is there a way of hiding this input.
I have used getpass to try and hide the input without success.
from getpass import getpass
passwd = getpass('Please enter your password')
This gives me the following warning message:
Warning (from warnings module): File "C:\Program Files (x86)\Python36-32\lib\getpass.py", line 100 return fallback_getpass(prompt, stream) GetPassWarning: Can not control echo on the terminal. Warning: Password input may be echoed. Please enter your password: this_is_my_password
The password is entered on the line but instead of coming up with astrisks it comes up with the original characters.
As the program will check the strength of the password I need to have something that does not save the password as the asterisks but as its original characters.
As well as this is there any way of incorporating a way of showing the user password if they perform an action. I was considering using a button but that is an area in Python I am not confident with so could I program in another way with a specific key.
Sudo code for project.
userPass = hidden(input("Please enter your password "))
if showPassword selected:
show the password
else:
move on with the rest of the program