Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Heres my code. I can't get it to work. I'd like to reiterate that I don't understand this solution and it is far beyond my capabilities.
- ```
- CheckName = "user3"
- CheckPass = "pass3"
- path = r"C:\Users\\drago\\Desktop\PythonPractice\Accounts2.txt"
- InFile = open(path, "r")
- CredentialsString = str(InFile.read())
- InFile.close()
- import re
- def check_password(check_username, check_password):
- for match in re.finditer(r'\[([^\[,\]]+),([^\[,\]]+)\]', CredentialsString):
- username, password = match.groups()
- def check_password(CheckName,CheckPass):
- for match in re.finditer(CredentialsString):
- username, password = match.groups()
- if (username, password) == (check_username, check_password):
- print('Login successful')
- return
- print('Login unsuccessful')
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement