python对话框,并选择yes/no

python 自带的 tkinter 库 是这样实现的

#!/usr/bin/python
# -*- coding: UTF-8 -*-

from Tkinter import *
 
from tkMessageBox import *
 
def answer():
 
    showerror("Answer", "Sorry, no answer available")
    
def callback():
 
     askyesno('Verify', 'Really quit?')
 
 
Button(text='YE', command=callback).pack(fill=X)
 
Button(text='NO', command=answer).pack(fill=X)
 
mainloop()

原文地址:https://www.cnblogs.com/yingfei/p/7291690.html