15 January,2022 by Rambler
Question: How do I hide user input for a password entry using Python? So instead of the password displaying as the user types the password , the screen wouldn't change.
Answer: There is the getpass() function , which comes as standard part of the Python Library . From the Python documentation: "Prompt the user for a password without echoing. The user is prompted using the string prompt, which defaults to 'Password: '"
import getpass
password = getpass.getpass()
print(password)
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |