[Python] Final assignment/course design educational administration system

We sincerely accept computer professional programming assignments (C language, C++, Python, Java, HTML, JavaScript, Vue, etc.),

The price is 15RMB each. If you need it, please contact me via private message.

Download address of resources for this article: https://download.csdn.net/download/weixin_47040861/88309964

———————————————————————————————————————————

The program contains 4 py files, corresponding to the main interface, student interface, teacher interface, and administrator interface.

When the user starts the program for the first time, the program will first generate txt files named "Student Information" and "Teacher Information" in the same directory as the py file to store subsequent content.

Related code:

def check_and_create_files():
    # 检查当前目录下是否存在“教师信息.txt”文件
    teacher_file = "教师信息.txt"
    if not os.path.isfile(teacher_file):
        # 如果不存在,则创建文件并写入一些示例内容
        open(teacher_file, "w")

    # 检查当前目录下是否存在“学生信息.txt”文件
    student_file = "学生信息.txt"
    if not os.path.isfile(student_file):
        # 如果不存在,则创建文件并写入一些示例内容
        open(student_file, "w")

Then the login window is opened, and the user selects login items based on his or her personal identity:

1. Administrator function

Let’s introduce it backwards. The first is the administrator login. The administrator’s login account and password are both fixed at 111111. If necessary, the password can be modified on line 95 of the main.py file:

After clicking Administrator Login, the corresponding login window will pop up. Enter the correct password to enter the Administrator interface:

Administrator interface:

Although there are only four buttons in the administrator interface, there are more than four functions. First, click the teacher information button and a new window will pop up to display the personal information of all teachers. The administrator can modify or add teachers in this window. information, and then click the save button to save it. Here I have entered part of the teacher information in advance:

This information will eventually be saved in the form of an object in the "Teacher Information.txt" file:

Similarly, clicking the student information button will pop up the corresponding window. You can also modify and add information. There will be no repeated display here.

Then there is the Add Teacher button. After clicking the button, a corresponding window will pop up. There are four input boxes in the window. After entering the content in the input box, click the submit button to add new content to the "Teacher Information.txt" file:

Finally, there is a clear data button, which can clear the contents of the two txt files "Student Information" and "Teacher Information".

2.Teacher function

After the administrator adds the teacher's account to the system, the teacher can click the teacher login button in the login window, enter the account password and log in. After successful login, enter the teacher page:

Clicking the personal information button will pop up a new window to display the teacher's personal information. This information is extracted from the file based on the account number entered by the teacher. Click the Change Password button at the bottom of the window to modify the teacher's personal password:

To change the password, you need to enter the original password and the new password twice. If the original password is wrong or the new password entered twice is inconsistent, a prompt will appear:

I made a mistake in the design here. Even though the original password was displayed in the window, I still had to enter it again for verification. I'm a fool.

Then there is the student information button. The teacher's student information button will display the information of students who are consistent with the teacher's subjects, and cannot be modified directly. In the setting, students and teachers can only modify their own information, while administrators can modify everyone's:

There are four pieces of information in the file, but because Zhang San teaches Chinese class, only two pieces of information from the Chinese class are displayed.

The teacher's add student button is also similar to the administrator's, except that the student's grades are programmed in the last subject:

After entering the content, click the submit button to submit and save it to the file.

The last step is to modify the grades. As long as the content is entered in the corresponding input box, the teacher can directly modify the student's grade according to the student's student number. If the entered student's student number does not exist, it will prompt that it does not exist:

3.Student function

Click the student login button in the login window, enter your student ID and password and enter the student information page:

On this page, students can view their personal information and grades, and on the student information page, they can modify their personal passwords:

The above are all the functions implemented by this program.

Guess you like

Origin blog.csdn.net/weixin_47040861/article/details/132739242