移除了无用的库,小优化

This commit is contained in:
13632530821
2022-11-20 00:07:57 +08:00
parent aac15b255a
commit e934ad703a

View File

@@ -3,9 +3,7 @@ from tkinter import *
import tkinter.messagebox as msgbox
import random
import sys
import win32con, win32api
import winsound
import time
filename = "./data/names.xls"
configname = "./data/config.data"
@@ -119,8 +117,6 @@ for i in range(elim_rows,rows):
student = Student(tmp_list[0],tmp_list[1],tmp_list[2],tmp_list[3])
students.append(student)
cur_stu = []
cur_stu = students[:]
for student in students:
@@ -164,8 +160,6 @@ def sel_class(flag = 1):
filter = classes[:]
cur_stu = students[:]
def choose():
global last_choice, cur_stu
sel_class(0)
@@ -206,11 +200,8 @@ def choose():
winsound.PlaySound(selname, winsound.SND_ASYNC | winsound.SND_FILENAME)
startrandom = Button(gui, text = "立刻摇人!", font = ("宋体", 17, "bold"), height = 2, fg = "red", command = choose, bg = "white")
setclass = Button(gui, text = "应用班级选用", font = ("宋体", 17), height = 2, command = sel_class, bg = "white")
scrool = Scrollbar(gui, command = listbox.yview)
listbox.config(yscrollcommand=scrool.set)
name_label = Label(gui, textvariable = cur_name, font = ("宋体", 30, "bold"), width = 20, bg = "white", fg = "blue")