當前位置:成語大全網 - 新華字典 - python中tkinter treeview如何獲取選中的條目

python中tkinter treeview如何獲取選中的條目

定義這樣的函數去專門取tree上的值

def selectItem(a):

curItem = tree.focus()

print tree.item(curItem)

它返回壹個字典類型的集合,妳只要遍歷字典就可以把妳需要的值取出來。。。