Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
3

How do you type letters and they appear as asterisks?

Python 3

Im trying to make a login page that automatically prints whatever is typed in asterisks.

3 years ago
You are viewing a single comment. View All
1

@TaylorLiang

from prompt_toolkit import prompt
import hashlib

def encrypt(text):
sha_sig =
hashlib.sha256(text.encode()).hexdigest()
return sha_sig

if encrypt(prompt('password: ', is_password=True)) == 'the sha256 hash':
"b3fa55f98fcfcaf6a15a7c4eb7cdd1b593693d3fef2fb7aec3b6768fd7c6a4ce"

print("hello")

Doesnt work?

the print("hello") is indented btw

3 years ago