techwithtim / 5-Python-Projects-For-Beginners

415 stars 235 forks source link

ValueError in Password Manager #16

Closed rewaj56 closed 1 year ago

rewaj56 commented 1 year ago

For people experiencing this issue, replace the below mentioned block of code with this: def view(): with open('passwords.txt', 'r') as f: for line in f.readlines(): if line == "\n": continue else: data = line.rstrip() user, passw = data.split("|") print("User:", user, "| Password:", fer.decrypt(passw.encode()).decode())

All this does is, skips a new line/empty line if it exists, in your passwords.txt file.

Screenshot (23)