import tkinter as tk
import random
window = tk.Tk()
window.title('拼音抽查系统')
window.geometry('400x200')
seq = ['a','o','e','i','u',
'ai','ei','ui','ao','ou','iu',
'ie','ue','er','an','en','in','un',
'ang','eng','ing','ong',
'b','p','m','f',
'd','t','n','l',
'g','k','h','j','q','x',
'zh','ch','sh','r','y','w']
num = len(seq)
index = 0
text2 = tk.StringVar()
on_hit1 = False
on_hit2 = False
def hit(a):
if a == False:
a = True
index = random.randint(0,num-1)
value = str(seq[index])
text2.set(value)
else:
a = False
l1 = tk.Label(window,text = '请读出下面的拼音',width = 100,height=2)
l2 = tk.Label(window,textvariable = text2,font = ('Arial',18),bg = 'yellow',width = 100,height=2)
b1 = tk.Button(window,text = '下一个',width = 15,height = 2,command = hit(on_hit1))
b2 = tk.Button(window,text = '退出',width = 15,height = 2,command = window.destroy)
l1.pack()
l2.pack()
b1.pack()
b2.pack()
window.mainloop()