4

Tkinter中messagebox的功能askquestion()和功能有什么区别?askyesno()

我在这个网站上找到了这两个函数:http: //infohost.nmt.edu/tcc/help/pubs/tkinter/web/tkMessageBox.html

4

1 回答 1

5

来源

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将返回YESor NO,同时askyesno将返回布尔值。

于 2015-11-06T02:54:14.887 回答