Advertisement
Guest User

Untitled

a guest
Oct 14th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. import time
  2. print("Welcome Mr Leeman, to your personal tutor group manager, Please log in (CaSe SeNsItIvE).")
  3. username ="Mr Leeman"
  4. password ="TreeRoad" # defining the functions
  5. UserInput=input("Enter Username: ")#Mr Leeman enters username
  6. PassInput=input("Enter Password: ")#Mr Leeman enters password
  7. if not UserInput.strip():
  8. print("You must not leave any areas blank!")
  9. if not PassInput.strip():
  10. print("You must not leave any areas blank!")
  11.  
  12. trials = 0
  13. while (PassInput != password or UserInput != username): #while Mr Leemchoice input for his credentials to not match expected
  14. if trials==2: # if he takes 3 tries
  15. exit() # then exit program
  16. else: # otherwise
  17. UserInput=input("Your username or password was incorrect: Re-Enter Username ") #if he has tried once or twice
  18. PassInput=input("Re-Enter Password ")# make him reenter credentials
  19.  
  20. trials+=1 # every time he fails an attempt, log it.
  21. if (PassInput == password and username == UserInput): # if Mr Leemchoice input matches the expected
  22. print("You have been logged in successfully " + UserInput) # informs Mr Leeman of his login
  23. time.sleep(1.5)
  24. menu=True
  25. while menu:
  26. print("""
  27. 1.Enter student details
  28. 2.View student details
  29. 3.Search by ID number
  30. 4.Create reports
  31. 5.Exit/Quit
  32. """) # All options for menu
  33. choice=input("What would you like to do? ") # give Mr Leeman the choice of the 4 actions
  34. if choice=="1":
  35. enterstudentdetails()
  36. elif choice=="2":
  37. viewallstudentinformation()
  38. elif choice=="3":
  39. idsearch()
  40. elif choice=="4":
  41. viewreports()
  42. elif choice=="5":
  43. exit()
  44. choice = None
  45. else:
  46. print("Choice must be 1,2,3,4 or 5.")
  47. time.sleep(0.5)
  48. print("Please try again")
  49.  
  50. def enterstudentdetails():
  51. print("aids")
  52. #Mr Leeman will enter student details
  53. #These will be added to the csv file (studentdetails.csv)
  54.  
  55. def viewallstudentinformation():
  56. pass
  57. #Mr Leeman can input a key which correlates to him being accessed to view all students
  58.  
  59.  
  60. def idsearch():
  61. pass
  62. #Mr Leeman can input an ID number (which will be assigned to a student) to display the relevant student's details
  63.  
  64.  
  65. def viewreports():
  66. pass
  67. #Mr Leeman can view reports such as:
  68. #a) list of names of males and email addresses
  69. #b) list of names of females and specific postcode
  70. #c) list of all names, birthdays and addresses
  71. #program initiated here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement