大学课堂点名程序
目录
main.py
import tkinter as tk
import pygame
import csv
import random
from datetime import datetime
from tkinter import messagebox
from tkinter import simpledialog
input_data="student1"
def langDu(text):
print(text)
pygame.mixer.init()
pygame.mixer.music.load("./Initialize/Roster/"+text+".mp3")
pygame.mixer.music.play()
while pygame.mixer.music.get_busy():
pygame.time.Clock().tick(10)
def langDu2(text):
print(text)
pygame.mixer.init()
pygame.mixer.music.load("./Initialize/RosterSystem/"+text+".wav")
pygame.mixer.music.play()
while pygame.mixer.music.get_busy():
pygame.time.Clock().tick(10)
def update_student_name():
global current_student_index
global shuffled_student_indices
if current_student_index < len(student_names):
student_index = shuffled_student_indices[current_student_index]
student_name_var.set(student_names[student_index])
try:
langDu(student_names[student_index])
except