Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1. Authentication
- authUsers=[]
- f=open("authUsers.txt","r")
- for line in f:
- line=line.strip("\n")
- authUsers.append(line.split())
- username=input("Enter your username: ")#asks user for username
- found=False#found is false
- aUlength=len(authUsers)#length of list
- while i<aUlength and found == False:
- if username == authUsers[i][0]:
- found==True
- else:
- i+=1
- if i==aUlength and found == False:
- auth=False
- print("Access Denied")
- password=input("Enter your password: ")
- if password == authUsers[i][1]:
- auth=True
- print("Access Granted")
- else:
- auth=False
- print("Access Denied")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement