Python tkinter.Button.configure()返回的值是什么

Python tkinter.Button.configure()返回的值是什么,python,python-3.x,tkinter,Python,Python 3.x,Tkinter,我不理解“button.configure(“text”)的输出。此函数返回一个元组。元组的元素是什么 from tkinter import * from tkinter import ttk root = Tk() button = ttk.Button(root, text=("Hello")) button.grid() print(button.configure("text")) root.mainloop() 输出为: ('text', 'text', 'Text', '

我不理解“button.configure(“text”)的输出。此函数返回一个元组。元组的元素是什么

from tkinter import *
from tkinter import ttk
root = Tk()


button = ttk.Button(root, text=("Hello"))
button.grid()

print(button.configure("text"))

root.mainloop()
输出为:

('text', 'text', 'Text', '', 'Hello')
从:

…否则列表将包含五个值:argvName, dbName、dbClass、defValue和当前值。当前值为 通过调用过程从widgRec的相应字段计算 就像颜色的名字一样

这意味着
tkinter
返回从五个值的列表中提取的元组,这五个值依次为:

argvName、dbName、dbClass、defValue和当前值

就你而言:

('text', 'text', 'Text', '', 'Hello')

argvName = 'text'  
dbName = 'text'
dbClass = 'Text'
defValue = ''
current value = 'Hello'

如果要直接检索按钮的文本,可以使用
按钮[“text”]