Advertisement
Guest User

Untitled

a guest
Aug 28th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import time #module used to add time delays to the program
  2.  
  3. login = False
  4. #username and password assigned
  5. loginDetails = ["school",
  6. "leeman"]
  7. while login == False:
  8.  
  9. loginUser = [input("Enter Username: "),
  10. input("Enter Password: ")]
  11.  
  12. for x in range (0,3):
  13. print("loading...")
  14. time.sleep(1)
  15. #use of selection to check whether the login details are correct
  16. if loginUser == loginDetails:
  17. print("Username Correct. Password Correct. \nAccess Granted. Welcome MR Leeman")
  18. login = True
  19. else:
  20. print("Incorrect details \n Please try again")
  21.  
  22.  
  23. file = open("students.csv", "r")
  24. number = int(input("Please enter student ID: "))
  25. for line in file:
  26. details = line.split(",")
  27. students = details[0]
  28. if number == students:
  29. print(file[0], " " ,file[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement