Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #1. Authentication
  2. authUsers=[]
  3. f=open("authUsers.txt","r")
  4.  
  5. for line in f:
  6. line=line.strip("\n")
  7. authUsers.append(line.split())
  8.  
  9. username=input("Enter your username: ")#asks user for username
  10. found=False#found is false
  11. aUlength=len(authUsers)#length of list
  12.  
  13. while i<aUlength and found == False:
  14. if username == authUsers[i][0]:
  15. found==True
  16. else:
  17. i+=1
  18. if i==aUlength and found == False:
  19. auth=False
  20. print("Access Denied")
  21. password=input("Enter your password: ")
  22. if password == authUsers[i][1]:
  23. auth=True
  24. print("Access Granted")
  25. else:
  26. auth=False
  27. print("Access Denied")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement