Ineedhellp123345
Ineedhellp123345

Reputation: 1

Python - Making a program to read a text file of usernames and passwords for authentication

I have a .txt in which stores the username and password.
Jane:1234

I have gotten to the point of reading from the file and storing them. I then need to get the users input to enter a username and password and authenticate if it is correct.

Upvotes: 0

Views: 468

Answers (1)

charlie brasso
charlie brasso

Reputation: 21

you can use .replace and .split

account_info = "username:password"
account_info_array = account_info.replace(":", " ").split()

['username', 'password']

Upvotes: 1

Related Questions