I am trying create a login system. The user creates their account and inputs the username and password they would like to use.
The username gets stored in line 1 of a new text file.
The password gets stored in line 2 of the text file.
Now I open the file and make it readable
user_file = open("user1.txt", "r")
Then I have the user enter the username created earlier.
username_login = input("Enter username ")
Now I want check to see if the username submitted is the one stored on line 1
if user_file.readline(1) != username_login:
print("Incorrect username")
else:
password_login = input("Enter Password ")
If the username submitted is correct it would match line 1 and therefore print the else statement. but instead I always get the "incorrect username" feedback