首页 > 编程语言 > 详细

python对话框,并选择yes/no

时间:2017-08-05 22:27:58      阅读:361      评论:0      收藏:0      [点我收藏+]

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

原文:http://www.cnblogs.com/yingfei/p/7291690.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!