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.
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.