tkinter 中 'askquestion' 和 'askyesno' 有什么区别?
What is the difference between 'askquestion' and 'askyesno' in tkinter?
Tkinter中messagebox的askquestion()
和askyesno()
函数有什么区别?
我在这个网站上找到了这两个函数:http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/tkMessageBox.html
来自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
将 return YES
或 NO
,同时 askyesno
将 return 一个布尔值。
Tkinter中messagebox的askquestion()
和askyesno()
函数有什么区别?
我在这个网站上找到了这两个函数:http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/tkMessageBox.html
来自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
将 return YES
或 NO
,同时 askyesno
将 return 一个布尔值。