import tkinter
from tkinter import *
window = tkinter.Tk()
window.title('IKUN的测试')
window.geometry('300x300')
window.resizable(0,0)
#标题
label1 = tkinter.Label(window,
text='真爱粉测试',
bg='gold',
font=('Times', 25),
width=50, height=2
)
label1.pack()
#题目
label2 = tkinter.Label(window,
text='请听题:\n山外青山楼外楼',
font=('Times', 15),
width=50, height=5
)
label2.pack()
#按钮:
#按钮指令
def answer1():
label1.pack_forget()
label4.pack_forget()
button4.pack_forget()
button5.pack_forget()
label666 = tkinter.Label(window, text='小黑子\n你没通过测试', font=('Times', 30), width=50, height=50)
label666.pack()
toplevel = Toplevel(window)
toplevel.title('小黑子 露出鸡脚了吧')
toplevel.geometry('400x180')
tkinter.Label(toplevel, text="小黑子!露出鸡脚了吧!\n香精煎鱼食不食", bg='red', font=('Times', 30), width=50, height=5).pack()
def answer2():
label1.pack_forget()
label4.pack_forget()
button4.pack_forget()
button5.pack_forget()
label8666 = tkinter.Label(window, text='恭喜你\n通过了测试', font=('Times', 30), width=50, height=50)
label8666.pack()
toplevel = Toplevel(window)
toplevel.title('恭喜过关')
toplevel.geometry('400x180')
tkinter.Label(toplevel, text="恭喜你通过了测试!\n欢迎加入IKUN大家庭", bg='gold', font=('Times', 30), width=50, height=5).pack()
def q3():
label3.pack_forget()
button3.pack_forget()
button4.pack_forget()
label4
label4.pack()
button5
button4.pack()
button6
button5.pack()
label3 = tkinter.Label(window, text='第二关-请听题:\n中分头背带裤', font=('Times', 15), width=50, height=5)
button3 = tkinter.Button(window,text="我是ikun你记住", width=25, height=2, command=q3)
button4 = tkinter.Button(window,text="丁真雪豹电子烟", width=25, height=2, command=answer1)
def q2():
label2.pack_forget()
button2.pack_forget()
button1.pack_forget()
label3
label3.pack()
button3
button3.pack()
button4
button4.pack()
label4 = tkinter.Label(window, text='终极关-请听题:\n千军万马是ikun', font=('Times', 15), width=50, height=5)
button5 = tkinter.Button(window,text="ikun永远爱坤坤", width=25, height=2, command=answer2)
button6 = tkinter.Button(window,text="ikun感觉不如丁真", width=25, height=2, command=answer1)
#按钮本体
button1 = tkinter.Button(window,text="西湖歌舞几时休",
width=25,
height=2,
command=answer1)
button1.pack()
button2 = tkinter.Button(window,text="唱跳rap打篮球",
width=25,
height=2,
command=q2)
button2.pack()
window.mainloop()