-
Notifications
You must be signed in to change notification settings - Fork 0
/
tinker_tutorial.py
45 lines (35 loc) · 1.67 KB
/
tinker_tutorial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from tkinter import Tk, Menu, Button, Label, Entry, Text
# In-memory data storage (replace with database integration later)
students = {} # Dictionary to store student data
# Function placeholders for opening windows (replace with actual window creation logic)
def open_register_student_window():
print("Register Student window is under development!")
def open_record_marks_window():
print("Record Marks window is under development!")
def open_view_student_data_window(student_id):
if student_id in students:
student_data = students[student_id]
# Display student data in a Text widget or other UI elements
print(f"Student ID: {student_id}")
print(f"Name: {student_data['name']}")
print(f"Class Level: {student_data['class_level']}")
# ... display other student data
else:
print(f"Student with ID {student_id} not found!")
# Create main window
root = Tk()
root.title("Student Management System")
# Create menu bar
menu_bar = Menu(root)
root.config(menu=menu_bar)
# Student menu
student_menu = Menu(menu_bar, tearoff=0)
student_menu.add_command(label="Register Student", command=open_register_student_window)
student_menu.add_command(label="Record Marks", command=open_record_marks_window)
student_menu.add_command(label="View Student Data", command=lambda student_id=None: open_view_student_data_window(student_id)) # Pass optional student ID
menu_bar.add_cascade(label="Students", menu=student_menu)
# Similar menus for Teachers, Classes, Performance Analysis, and Reports
# Exit button
exit_button = Button(root, text="Exit", command=root.quit)
exit_button.pack()
root.mainloop()