Guest User

white wigger

a guest
Oct 20th, 2017
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. loggedIn = False
  2. adminUser = "test"
  3. adminPass = "test"
  4.  
  5. def newStudent():
  6. print("")
  7.  
  8. def getStudent():
  9. print("")
  10.  
  11. def getReports():
  12. print("")
  13.  
  14. def logOut():
  15. print("")
  16.  
  17.  
  18. def showMenu():
  19. global loggedIn
  20. if loggedIn:
  21. print("\nTree Road School: "
  22. + "\n1: New Student"
  23. + "\n2: Retrieve Student Details"
  24. + "\n3: Reports"
  25. + "\n4: Logout")
  26. try:
  27. selection = int(input("\nSelection: "))
  28.  
  29. if selection == 1:
  30. newStudent()
  31. elif selection == 2:
  32. getStudent()
  33. elif selection == 3:
  34. getReports()
  35. elif selection == 4:
  36. logOut()
  37. else:
  38. return print("That's not a valid number, try again.")
  39. except ValueError:
  40. return print("That's not a valid number, try again.")
  41. else:
  42. print("\nPlease login access the menu")
  43. username = str(input("Username: "))
  44. password = str(input("Password: "))
  45. if username == adminUser:
  46. if password == adminPass:
  47. print("Logged into '" + username + "'")
  48. loggedIn = True
  49. else:
  50. print("Invalid username or password")
  51. else:
  52. print("Invalid username or password")
  53.  
  54. while True:
  55. showMenu()
Add Comment
Please, Sign In to add comment