python对话框,并选择yes/no,python弹出对话框,python 自带的


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()

python对话框,并选择yes/no

评论关闭