Guest User

Untitled

a guest
Mar 28th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. def login():
  2. file=open("user.txt","r")
  3. user=input("enter usename")
  4. password=input("enter password")
  5. Check=False
  6. for line in file:
  7. correct=line.split(":")
  8. if user==correct[0] and password==correct[1]:
  9. Check=True
  10. break
  11. if Check==True:
  12. print("succesffuly logged in")
  13. file.close()
  14. mainMenu()
  15. else:
  16. print("incorrect log in")
  17. file.close()
  18. login()
  19.  
  20. for line in file:
  21. correct=line.split(":")
  22.  
  23. for line in file:
  24. correct=line.strip().split(":")
  25.  
  26. def login():
  27. file = open("user.txt", "r")
  28. user = input("enter usename ")
  29. password = input("enter password ")
  30. if ('{0}:{1}'.format(user, password)) in file:
  31. print('yay')
  32. else:
  33. print('Boo !! User not found')
  34.  
  35. login()
  36.  
  37. def login():
  38. file = open("user.txt", "r")
  39. user = input("enter usename ")
  40. password = input("enter password ")
  41. for line in file:
  42. temp_user, temp_password = line.strip().split(':')
  43. if temp_user == user and temp_password == password.strip():
  44. print('yay')
  45. else:
  46. print('boo username and password not found!')
  47.  
  48.  
  49. login()
Add Comment
Please, Sign In to add comment