i am creating this basic login system and i want to replace the characters of the password as the user enters them and not display the password as the user enters it instead display the # symbol
def login() :
l_user = input('Username: ')
l_pass= input("password")
with open('username.txt', mode='r')as user_file:
validate_u = user_file.readlines()
with open('password.txt', mode='r')as pass_file:
validate_p = pass_file.readlines()
if l_user + "\n" in validate_u: # ReadLines() adds newlines
user_num = validate_u.index(l_user + "\n")
if l_pass + "\n" == validate_p[user_num]:
print("Password correct!")
else:
print("Password incorrect!")
else:
print("Cannot find your username!")