Advertisement
Guest User

Untitled

a guest
Aug 5th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. def getData (filename):
  2. textfile = open ("facepalm", "r")
  3. user1 = ["sj", "101", "fullname1", "age1", "address1"]
  4. user2 = ["lady", "byron", "fullname2", "age2", "address2"]
  5. masterlist = [[user1],[user2]]
  6. return masterlist
  7. textfile.close()
  8.  
  9. def usernameAndPasswordInput ():
  10. username = input ("Enter your username: ")
  11. password = input ("Enter your password: ")
  12. print ()
  13. for elmt in masterlist:
  14. if elmt [0]==username:
  15. if elmt [1]==password:
  16. return masterlist
  17. else:
  18. print ("Your username or password is incorrect.")
  19. print ()
  20. return False
  21.  
  22.  
  23. def main() :
  24. startMessage ()
  25. getData ("facepalm")
  26. LoginResponse = False
  27. while LoginResponse == False:
  28. Startresponse = startOptions ()
  29. if Startresponse == "1":
  30. LoginResponse = usernameAndPasswordInput ()
  31. elif Startresponse == "2" :
  32. quitMessage ()
  33. return
  34.  
  35. #LoginResponse
  36. if LoginResponse == True:
  37. HomePageResponse = homePageOptions ()
  38. #HomePageResponse
  39. if HomePageResponse == "1":
  40. viewProfile ()
  41. elif HomePageResponse == "2":
  42. viewMessages ()
  43. elif HomePageResponse == "3":
  44. Message = leaveMessage ()
  45. elif HomePageResponse == "4":
  46. Startresponse = startOptions ()
  47.  
  48. main ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement