Ask coding questions

← Back to all posts
When i try to Login it always says Login Failed....
JalaBrat (1)

its very simple and basic register/login program but it always says login failed, been digging for hours and cant get it right...

Answered by Geocube101 (245) [earned 5 cycles]
View Answer
Commentshotnewtop
Geocube101 (245)

On line 50, shouldn't you test for the password instead of the file object?

JalaBrat (1)

@Geocube101 Well in theory its supposed to open and read the .txt file where username and password are stored after registration and decide if login was a success or not :/

Geocube101 (245)

@JalaBrat I see that, but on line 50 you're trying to see if the file is in the lines which always returns false because the file object file1 is not inside of the string list returned by reading the file

Try:

if password_info2 in verify:
  login_succes()
else:
  login_failed()
JalaBrat (1)

@Geocube101 that makes so much sense idk how i didnt see it :D, thank you!!