mirror of
https://github.com/HChaZZY/Random-Picker.git
synced 2025-12-06 10:33:50 +08:00
移除了无用的库,小优化
This commit is contained in:
9
点名器.pyw
9
点名器.pyw
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user