Advertisement
bigewan

main.py (NEA)

Nov 27th, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.14 KB | None | 0 0
  1. import sys
  2. import random
  3. import os
  4. from pc_data import *
  5.  
  6.  
  7.  
  8.  
  9.  
  10. newacc = input("Do you need a new account? (Y/N)")
  11. if newacc in  ("Y","y"):
  12.     acctype = input("""What account type do you want?
  13.  
  14. 1 - Student
  15. 2 - Teacher
  16. 3 - Admin""")
  17.  
  18.     if acctype == "1":
  19.         sfn = input("Please enter your first name: ")
  20.         ssn = input("Please enter your second name: ")
  21.         syr = input("Pleae enter what year you are in: ")
  22.         #syr = int()
  23.         new_username = [sfn[0]+ssn+syr]
  24.         new_student_acc = [sfn, ssn, new_username]
  25.  
  26.         pc_student.append(new_student_acc)
  27.  
  28.         print("Ok, your account user name is:", new_username,"now lets get you a password")
  29.         print("")
  30.         u_password = input("Please enter a password: ")
  31.         u_password_confirm = input("Please re enter your password: ")
  32.  
  33.         if u_password == u_password_confirm:
  34.             pass
  35.         else:
  36.             print("Passwords do not match! Please try again.")
  37.             sys.exit() #this is so the program does not run on
  38.  
  39.         print("")
  40.         print("Success! You have now got a basic 'Student' PC account!")
  41.         print("")
  42.  
  43.  
  44.     elif acctype == "2":
  45.         tfn = input("Please enter your first name: ")
  46.         tsn = input("Please enter your first name: ")
  47.         Numbers = range(1, 999)
  48.         RandomNumber = random.choice(Numbers)
  49.         print("")
  50.         print ("Your account username is: ",  tfn[0] + tsn + str(RandomNumber),"Now lets get you a password.")
  51.         print("")
  52.  
  53.         t_password = input("Please enter a password: ")
  54.         t_password_confirm = input("Please confirm your password: ")
  55.  
  56.         if t_password == t_password_confirm:
  57.             pass
  58.         else:
  59.             print("Passwords do not match! Please restart the program!")
  60.             sys.exit()
  61.  
  62.  
  63.  
  64. elif newacc == "N":
  65.     pass
  66.  
  67. else:
  68.     print("Invalid input!")
  69.  
  70.  
  71.  
  72. startup = int(input("""Welcome User! What would you like to login as?
  73.  
  74. 1 - Student
  75. 2 - Teacher
  76. 3 - Admin)"""))
  77.  
  78. if startup == 1:
  79.     print("Startup 1")
  80.  
  81.  
  82. elif startup == 2:
  83.     print("Startup 2")
  84.  
  85. elif startup == 3:
  86.     print("Startup 3")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement