Advertisement
Guest User

Untitled

a guest
Oct 6th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. with open('text.txt') as f:
  2. credentials = [x.strip().split(':') for x in f.readlines()]
  3.  
  4. for username,password in credentials:
  5.  
  6. user_input = input('Please Enter username: ')
  7.  
  8.  
  9.  
  10. if user_input != username:
  11.  
  12. sys.exit('Incorrect incorrect username, terminating... n')
  13.  
  14.  
  15.  
  16. user_input = input('Please Enter Password: ')
  17.  
  18.  
  19.  
  20. if user_input != password:
  21.  
  22. sys.exit('Incorrect Password, terminating... n')
  23.  
  24.  
  25.  
  26. print ('User is logged in!n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement