下面是我的代码,如果问题得到解答,我不能让它开始另一个问题。Python messagebox
我有一个应用程序询问的问题列表,但在这里发布它们都是毫无意义的。我无法弄清楚如何继续提问。
from tkinter import *
from random import randint
from tkinter import ttk
def correct():
vastus = ('correct')
messagebox.showinfo(message=vastus)
def first():
box = Tk()
box.title('First question')
box.geometry("300x300")
silt = ttk.Label(box, text="Question")
silt.place(x=5, y=5)
answer = ttk.Button(box, text="Answer 1", command=correct)
answer.place(x=10, y=30, width=150,)
answer = ttk.Button(box, text="Answer 2",command=box.destroy)
answer.place(x=10, y=60, width=150)
answer = ttk.Button(box, text="Answer 3", command=box.destroy)
answer.place(x=10, y=90, width=150)
first()
你能扩大你的代码片段实际上包括为'correct'即您的留言呼叫框? – poke
当正确答案时,它调用消息框。但我不明白你的问题。 – user1794625
没关系,我错过了第一个按钮上的'command = correct'部分。 – poke