Tkinter中messagebox的askquestion()
和askyesno()
功能有什么区别?
我在这个网站上找到了这两个功能:http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/tkMessageBox.html
答案 0 :(得分:3)
来自the source:
def askquestion(title=None, message=None, **options):
"Ask a question"
return _show(title, message, QUESTION, YESNO, **options)
def askyesno(title=None, message=None, **options):
"Ask a question; return true if the answer is yes"
s = _show(title, message, QUESTION, YESNO, **options)
return s == YES
因此,不同之处在于askquestion
将返回YES
或NO
,同时askyesno
将返回布尔值。