Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import*
- with open('NEA_Summer_Username_Password_Peter_Leyden.txt', 'a')as f:
- f.write(' ')
- with open('NEA_Summer_Username_Password_Peter_Leyden.txt', 'r')as f:
- string33 = f.read()
- if string33 == ' ':
- username = input("Please input the username you want to use: ")
- password = input("Please input the password you want to use: ")
- num = 1
- num15 = 0
- num30 = 1000
- with open('NEA_Summer_Student_File_Peter_Leyden.txt', 'w')as f:
- for x in range(0, 25):
- num50 = randint(0,1)
- num30 += 1
- num15 += 1
- num14 = str(num15)
- num31 = str(num30)
- f.write('Student ID: ')
- num4 = str(num30)
- f.write(num4)
- f.write("\nSurname: Leyden")
- f.write(num14)
- f.write("\nForename: Peter")
- f.write(num14)
- f.write('\nDate of Birth: ')
- f.write(num14)
- f.write("/07/2003\nHome Address: ")
- f.write(num14)
- f.write(" Campion Lane\nHome Phone Number: 0800 04 05 ")
- f.write(num14)
- if num50 == 0:
- f.write("\nGender: Male\n")
- else:
- f.write("\nGender: Female\n")
- f.write("Tutor Group: Maple\n")
- f.write("School Email Address: ")
- f.write(num4)
- f.write("@school.co.uk\n\n")
- with open('NEA_Summer_Username_Password_Peter_Leyden.txt', 'w')as g:
- g.write(username)
- g.write('\n')
- g.write(password)
- g.write('\n')
- g.write(num14)
- else:
- with open('NEA_Summer_Username_Password_Peter_Leyden.txt', 'r')as f:
- username8 = f.readline()
- password9 = f.readline()
- num29 = f.readline()
- num15 = int(num29)
- num30 = num15+1000
- while True:
- num1 = 0
- while num1 == 0:
- username1 = input("Please input your username: ")
- string32 = ("\n")
- username3 = username1+string32
- password1 = input("Please input your password: ")
- password3 = password1+string32
- with open('NEA_Summer_Username_Password_Peter_Leyden.txt', 'r')as h:
- username2 = h.readline()
- password2 = h.readline()
- if username2 == username3 and password2 == password3:
- print("Thank you for Logging in")
- done = input("Press enter to continue: ")
- num = 0
- num1 = 1
- else:
- print("Either the username or password is incorrect please try again")
- while num == 0:
- for x in range(0,50):
- print(" ")
- print("Which operations would you like to do access student information(a)")
- print("Reset password(r)")
- print("And three other reports")
- print("See all student information(f)")
- print("Add a student to the form(s)")
- operation = input("Or log out(l): ")
- if operation == 'a':
- print('')
- try:
- student_id = int(input("Please input the student's unique ID number: "))
- print("Please input a number.")
- if student_id <= 1000 or student_id > num30:
- print("That is not valid.")
- else:
- student_id1 = student_id - 1000
- num6 = student_id1 - 1
- num7 = 8
- num8 = num6 * 10
- num9 = num8 + num7
- num10 = num8 - 1
- with open('NEA_Summer_Student_File_Peter_Leyden.txt', 'r')as f:
- for x in range(0, num10):
- f.readline()
- for x in range(0, 10):
- fr = f.readline()
- print(fr, end='')
- except ValueError:
- print("Please input a number.")
- print('')
- done = input("Press enter to continue: ")
- elif operation == 's':
- with open('NEA_Summer_Student_File_Peter_Leyden.txt', 'a')as f:
- Surname = input("Please input the new student's Surname: ")
- Forename = input("Please input the new student's Forename: ")
- D_O_B = input("Please input the new student's Date Of Birth: ")
- Home_Address = input("Please input the new student's Home Address: ")
- H_P_N = input("Please input the new student's Home Phone Number: ")
- Gender = input("Please input the new student's Gender: ")
- num15 += 1
- num14 = str(num15)
- num30 += 1
- f.write('Student ID: ')
- num4 = str(num30)
- f.write(num4)
- f.write("\n")
- f.write("Surname: ")
- f.write(Surname)
- f.write("\nForename: ")
- f.write(Forename)
- f.write('\nDate of Birth: ')
- f.write(D_O_B)
- f.write("\nHome Address: ")
- f.write(Home_Address)
- f.write("\nHome Phone Number: ")
- f.write(H_P_N)
- f.write("\nGender: ")
- f.write(Gender)
- f.write("\nTutor Group: Maple\n")
- f.write("School Email Address: ")
- f.write(num4)
- f.write("@school.co.uk\n\n")
- print("You have added a student.")
- with open('NEA_Summer_Username_Password_Peter_Leyden.txt', 'w')as f:
- f.write(username2)
- f.write(password2)
- f.write(num14)
- done = input("Press enter to continue: ")
- elif operation == 'r':
- passthing = input("This is where your reset your password do you want to continue(c) or stop(s): ")
- if passthing == 'c':
- username3 = input("Please input your username: ")
- password5 = input("Please input your current password: ")
- with open('NEA_Summer_Username_Password_Peter_Leyden.txt', 'r')as f:
- username6 = f.readline()
- password6 = f.readline()
- username7 = username3+string32
- password8 = password5+string32
- if password6 == password8 and username6 == username7:
- password3 = input("Please enter your new password: ")
- password4 = input("Please re-enter your new password: ")
- if password3 == password4:
- print("You have reset your password.")
- password = password3
- username = username7
- with open('NEA_Summer_Username_Password_Peter_Leyden.txt', 'w')as f:
- f.write(username)
- f.write(password)
- f.write("\n")
- else:
- print('You have entered 2 different passwords please try again')
- else:
- print("The username and password do not match")
- elif passthing == 's':
- print("You chose not to use the password reset function")
- else:
- print("That is not valid")
- done = input("Press enter to continue: ")
- elif operation == 'l':
- print("You have now logged out.")
- num = 1
- elif operation == 'f':
- with open('NEA_Summer_Student_File_Peter_Leyden.txt', 'r')as f:
- fr = f.read()
- print(fr)
- done = input("Press enter to continue: ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement