다음은 제 코드입니다. 질문에 대한 답변이 있으면 다른 질문을 시작할 수 없습니다.Python 메시지 상자
나는 앱에서 묻는 질문 목록이 있지만 여기에 모두 게시하는 것은 의미가 없습니다. 나는 계속 질문하는 법을 알아낼 수 없다.
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()
당신이 당신의 코드 추출을 확장 할 수 있습니다 상자? – poke
정답에 응답하면 messagebox를 호출합니다. 그러나 나는 당신의 질문을 이해할 수 없습니다. – user1794625
신경 쓰지 마라, 첫 번째 버튼에서'command = correct' 부분을 놓쳤다. – poke