欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Python tkinter 樹形列表控件(Treeview)的使用方法

 更新時間:2021年04月09日 10:06:39   作者:風華明遠  
這篇文章主要介紹了Python tkinter 樹形列表控件(Treeview)的使用方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧

1.方法

方法 描述
bbox(item, column=None) 返回指定item的框選范圍,或者單元格的框選范圍
column( cid, option=None, **kw) 設(shè)置或者查詢某一列的屬性
delete(*items) 刪除指定行或者節(jié)點(含子節(jié)點)
vdetach(*items) 與delete類似,不過不是真正刪除,而是隱藏了相關(guān)內(nèi)容??梢杂胢ove方法重新顯示v
exists(item) 判斷指定的item是否存在
focus(item=None) 獲得選定item的iid,或者選中指定item。
get_children(item=None) 返回指定item的子節(jié)點
heading(column, option=None, **kw) 設(shè)置或者查詢表頭行的配置參數(shù)
identify(component, x, y) 返回在坐標(x,y)處的部件信息。部件包括:region(heading,cell等), item, column, row, 和 element。
identify_element(x, y) 返回在(x,y)處的元素。
identify_region(x, y) 返回坐標(x,y)處的Tree view組成部分
identify_row(y) 給定y坐標,返回指定item索引
index(item) 返回數(shù)字化的item索引,從0開始
set_children(item, *newchildren) 設(shè)置item的新子節(jié)點為newchildren,現(xiàn)有的子節(jié)點會被移除。一般用于樹形結(jié)構(gòu)中。
insert(parent, index, iid=None, **kw) 插入一個新的item
item(item, option=None, **kw) 返回item節(jié)點的相關(guān)信息
move(item, parent, index) move()方法有兩種作用:
(1)將detach的item重新顯示(reattach)
(2)移動item指定的節(jié)點到parent的子節(jié)點中,位置由index指定
next(item) 返回item的下一個節(jié)點
parent(item) 返回item的父節(jié)點
prev(item) 返回item的前一個節(jié)點
see(item) 保證item指定的節(jié)點在Treeview控件中可見
selection(items=None) 返回當前選定的節(jié)點的iid
selection_set(*items) 選中items指定的節(jié)點
selection_remove(*items) 從當前選擇中移除items指定的節(jié)點
selection_add(*items) 將items指定的節(jié)點添加到當前的選擇中
selection_toggle(*items) 選中的節(jié)點變?yōu)椴贿x中,未選中的節(jié)點變?yōu)檫x中
set(item, column=None, value=None) 設(shè)置或者獲得節(jié)點信息
tag_bind( tagname, sequence=None, callback=None) 給tagname指定的tag綁定事件以及回調(diào)函數(shù)
tag_configure( tagname, option=None, **kw) 配置或者獲得tag的有關(guān)信息
tag_has(tagname, item=None) 判斷tag是否存在或者是tag與那些節(jié)點關(guān)聯(lián)

1.1 bbox(item, column=None)

獲取指定item的框選范圍。如果指定的item可見,返回值是一個四元組(x,y,w,h)。(x,y)是矩形框選的左上角坐標,(w,h)是矩形的寬度與高度。有這個四元組設(shè)定的矩形正好可以框選指定的item。如果column不為空,返回的是指定單元格的框選范圍。

坐標值是以Treeview控件為基準的,而不是以窗口或者屏幕。

import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('320x240')
tk.Label(root,text='成績表').pack()
area=('#','數(shù)學','語文','英語')
ac=('all','m','c','e')
data=[('張三','90','88','95'),
      ('李四','100','92', '90'),
      ('王二','88','90', '91')
      ]
tv=ttk.Treeview(root,columns=ac,show='headings',
                height=7,padding=(10,5,20,30))
for i in range(4):
    tv.column(ac[i],width=70,anchor='e')
    tv.heading(ac[i],text=area[i])
tv.pack()
for i in range(3):
    tv.insert('','end',values=data[i])
def select(*args):
    print(tv.bbox(tv.selection()))
    print(tv.bbox(tv.selection(),column='c'))   
tv.bind('<<TreeviewSelect>>',select)
root.mainloop()

 結(jié)果:
(11, 50, 280, 20)
(151, 50, 70, 20)

說明:輸出的結(jié)果有2個,一個是選中行的框選范圍,一個是選中行的第三個單元格的框選范圍。

1.2 column( cid, option=None, **kw)

查詢或者修改指定列的配置。cid可以是整數(shù),也可以列的別名。如果不輸入option,則返回目前的配置選項字典。
Treeview列的選項有:

選項 含義
anchor 對齊模式。取值有n,e,s,w,ne,nw,se,sw和center。
id 列的名稱或者標識
minwidth 列的最小寬度,調(diào)整列寬的時候,不會小于這個數(shù)值。默認值是20
stretch 是否隨著窗口大小的調(diào)整而拉伸Treeview。默認值是True
width 定義列寬。默認值是200

查詢代碼:

import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('320x240')
tk.Label(root,text='成績表').pack()
area=('#','數(shù)學','語文','英語')
ac=('all','m','c','e')
data=[('張三','90','88','95'),
      ('李四','100','92', '90'),
      ('王二','88','90', '91')
      ]
tv=ttk.Treeview(root,columns=ac,show='headings',
                height=7,padding=(10,5,20,30))
for i in range(4):
    tv.column(ac[i],width=70,anchor='e')
    tv.heading(ac[i],text=area[i])
tv.pack()
for i in range(3):
    tv.insert('','end',values=data[i])   
print(tv.column(3))
root.mainloop()

結(jié)果:
{'width': 70, 'minwidth': 20, 'stretch': 1, 'anchor': 'e', 'id': 'e'}

設(shè)置代碼:

import tkinter as tk
from tkinter import ttk 
root = tk.Tk()
root.geometry('320x240')
tk.Label(root,text='成績表').pack()
area=('#','數(shù)學','語文','英語')
ac=('all','m','c','e')
data=[('張三','90','88','95'),
      ('李四','100','92', '90'),
      ('王二','88','90', '91')
      ]
tv=ttk.Treeview(root,columns=ac,show='headings',
                height=5)
for i in range(4):
    tv.column(ac[i],width=70,anchor='e')
    tv.heading(ac[i],text=area[i])
tv.pack()
for i in range(3):
    tv.insert('','end',values=data[i])
def column():
    tv.column(2,width=50)
ttk.Button(root,text='Column',command=column).pack()
root.mainloop()

結(jié)果:

在這里插入圖片描述在這里插入圖片描述

說明:點擊'Column'按鈕后,語文成績那一列的寬度由70變?yōu)?0。

1.3 delete(items)

刪除指定的item。子節(jié)點也會被一起刪除,但是第一層節(jié)點不會被刪除。

import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('320x240')
tk.Label(root,text='成績表').pack()
area=('#','數(shù)學','語文','英語')
ac=('all','m','c','e')
data=[('張三','90','88','95'),
      ('李四','100','92', '90'),
      ('王二','88','90', '91')
      ]
tv=ttk.Treeview(root,columns=ac,show='headings',
                height=5)
for i in range(4):
    tv.column(ac[i],width=70,anchor='e')
    tv.heading(ac[i],text=area[i])
tv.pack()
for i in range(3):
    tv.insert('','end',values=data[i])
def delete():
    tv.delete(tv.selection())
ttk.Button(root,text='Delete',command=delete).pack()
root.mainloop()

結(jié)果:

在這里插入圖片描述在這里插入圖片描述

1.4 detach(items)

detach的方法與delete類似,不過detach不是真正的刪除了指定的item,而是隱藏了內(nèi)容,可以使用move的方法重新將隱藏的數(shù)據(jù)再顯示出來。

import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('320x240')
tk.Label(root,text='成績表').pack()
area=('#','數(shù)學','語文','英語')
ac=('all','m','c','e')
data=[('張三','90','88','95'),
      ('李四','100','92', '90'),
      ('王二','88','90', '91')
      ]
tv=ttk.Treeview(root,columns=ac,show='headings',
                height=5)
for i in range(4):
    tv.column(ac[i],width=70,anchor='e')
    tv.heading(ac[i],text=area[i])
tv.pack()
for i in range(3):
    tv.insert('','end',values=data[i])
detach=None
index=None
def detach():
    global detach
    global index
    detach=tv.selection()
    index=tv.index(detach)
    tv.detach(detach)
def attach():
    global detach
    global index
    if detach:
        tv.move(detach,'',index)
ttk.Button(root,text='Detach',command=detach).pack()
ttk.Button(root,text='Attach',command=attach).pack()
root.mainloop()

說明:先選中一行,然后點擊'Detach'按鈕,此時會將選中的行隱藏。但是相關(guān)的id和index會依舊被記錄。再點擊'Attach'按鈕,使用move()方法就會重新顯示隱藏的數(shù)據(jù)。

1.5 exists(item)

判斷指定的item是否存在。需要注意的是,使用detach()方法隱藏的item會被認為是存在的,因為相應(yīng)的id等信息是依然被系統(tǒng)記錄沒有清空的。返回值為True,如果指定的item不存在,否則返回False。

import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('320x240')
tk.Label(root,text='成績表').pack()
area=('#','數(shù)學','語文','英語')
ac=('all','m','c','e')
data=[('張三','90','88','95'),
      ('李四','100','92', '90'),
      ('王二','88','90', '91')
      ]
tv=ttk.Treeview(root,columns=ac,show='headings',
                height=5)
for i in range(4):
    tv.column(ac[i],width=70,anchor='e')
    tv.heading(ac[i],text=area[i])
tv.pack()
for i in range(3):
    tv.insert('','end',values=data[i])
print(tv.exists('I002'))
root.mainloop()

結(jié)果:
結(jié)果為True

1.6 focus(item=None)

focus()方法有三種情況:
(1)有item被選中同時參數(shù)為None
返回當前被選中的item的標識iid
(2)無item被選中同時參數(shù)為None
返回空字符串''
(3)輸入item參數(shù)
指定的item會獲得focus。
注意:獲得focus不表示被選中。

#有item被選中同時參數(shù)為None,返回iid
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('320x240')
tk.Label(root,text='成績表').pack()
area=('#','數(shù)學','語文','英語')
ac=('all','m','c','e')
data=[('張三','90','88','95'),
      ('李四','100','92', '90'),
      ('王二','88','90', '91')
      ]
tv=ttk.Treeview(root,columns=ac,show='headings',
                height=5)
for i in range(4):
    tv.column(ac[i],width=70,anchor='e')
    tv.heading(ac[i],text=area[i])
tv.pack()
for i in range(3):
    tv.insert('','end',values=data[i])
def focus():
    print(tv.focus())
ttk.Button(root,text='Focus',command=focus).pack()

root.mainloop()

結(jié)果:

在這里插入圖片描述

結(jié)果為:I003

在這里插入圖片描述

#無item被選中同時參數(shù)為None
#item參數(shù)不為空
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('320x240')
tk.Label(root,text='成績表').pack()
area=('#','數(shù)學','語文','英語')
ac=('all','m','c','e')
data=[('張三','90','88','95'),
      ('李四','100','92', '90'),
      ('王二','88','90', '91')
      ]
tv=ttk.Treeview(root,columns=ac,show='headings',
                height=5)
for i in range(4):
    tv.column(ac[i],width=70,anchor='e')
    tv.heading(ac[i],text=area[i])
tv.pack()
for i in range(3):
    tv.insert('','end',values=data[i])
def focus():
    tv.focus('I002')
    print(tv.focus())
ttk.Button(root,text='Focus',command=focus).pack()
root.mainloop()

注:使用focus()方法,并不會讓獲得focus的item被高亮顯示。如果要高亮顯示,請使用selection_set()方法。

1.7 get_children(item=None)

返回指定item的子節(jié)點。如果該item沒有子節(jié)點返回None。如果沒有指定節(jié)點,默認返回root節(jié)點的子節(jié)點。

1.8 heading(column, option=None, **kw)

設(shè)置或者查詢表頭行的配置參數(shù)。如果是表格形式的,column是列的位置(就是第幾列,從0計數(shù))或者列的別名。如果是樹形結(jié)構(gòu)的(比如文件目錄),column的值為'#0'。
如果沒有option參數(shù),返回的是當前的配置數(shù)據(jù)。
heading的選項有:

選項 含義
anchor 對齊模式。取值有n,e,s,w,ne,nw,se,sw和center。
command 與指定列相關(guān)的回調(diào)函數(shù)
image 在表頭顯示圖片
text 在表頭顯示文本
state 當前列的狀態(tài)

import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('320x240')
tk.Label(root,text='成績表').pack()
area=('#','數(shù)學','語文','英語')
ac=('all','m','c','e')
data=[('張三','90','88','95'),
      ('李四','100','92', '90'),
      ('王二','88','90', '91')
      ]
tv=ttk.Treeview(root,columns=ac,show='headings',
                height=5)
for i in range(4):
    tv.column(ac[i],width=70,anchor='e')
    tv.heading(ac[i],text=area[i])
tv.pack()
for i in range(3):
    tv.insert('','end',values=data[i])
def heading():
    print(tv.heading(column=1))
ttk.Button(root,text='Heading',command=heading).pack()
root.mainloop()

結(jié)果:
{'text': '數(shù)學', 'image': '', 'anchor': 'center', 'command': '', 'state': ''}

1.9 identify(component, x, y)

返回在坐標(x,y)處的部件信息。部件包括:region(heading,cell等), item, column, row, 和 element。

import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('320x240')
tk.Label(root,text='成績表').pack()
area=('#','數(shù)學','語文','英語')
ac=('all','m','c','e')
data=[('張三','90','88','95'),
      ('李四','100','92', '90'),
      ('王二','88','90', '91')
      ]
tv=ttk.Treeview(root,columns=ac,show='headings',
                height=5)
for i in range(4):
    tv.column(ac[i],width=70,anchor='e')
    tv.heading(ac[i],text=area[i])
tv.pack()
for i in range(3):
    tv.insert('','end',values=data[i])
def identify():
    print(tv.identify('region',120,30))
ttk.Button(root,text='Identify',command=identify).pack()
root.mainloop()

結(jié)果:
cell

1.10 identify_column(x)

給定x坐標,返回所屬的列號。返回值的格式是'#n'。n是從1開始計數(shù)的列號。注意返回的是實際的顯示列號,而不是邏輯定義的列號。如果使用了displaycolumns就可以實際顯示的列號與columns定義的列號是不一致的情況。具體的用法與identify類似,可以參考。

1.11 identify_element(x, y)

返回在(x,y)處的元素。使用方法是: tv.identify_element(140,25)

1.12 identify_region(x, y)

返回坐標(x,y)處的Tree view組成部分。Treeview 的組成部分有:

組成部分 含義
nothing 不在Treeview控件內(nèi)
heading 位于表頭的位置
separator 在分隔線上
tree 位于圖標列(樹形列表表示展開/折疊的圖標)
cell 位于單元格內(nèi)

使用方法是:

tv.identify_region(140,25)

1.13 identify_row(y)

給定y坐標,返回指定item索引(如‘I002')。如果沒有內(nèi)容,返回空字符串。
使用方法:

tv.index(‘I002')

1.14 index(item)

返回數(shù)字化的item索引,計數(shù)從0開始。使用方法:

tv.index(‘I002')

1.15 set_children(item, newchildren)

設(shè)置item的新子節(jié)點為newchildren,現(xiàn)有的子節(jié)點會被移除。一般用于樹形結(jié)構(gòu)中。

tv.set_children('I003','I00E')

說明:將I00E作為新的I003的子節(jié)點。

1.16 insert(parent, index, iid=None, **kw)

插入一個新的item。
(1)parent
對于表格類型的Treeview,parent一般為空。對于樹形類型的Treeview,parent為父節(jié)點。
(2)index
指明在何處插入新的item??梢允?end',也可以是數(shù)字。比如,如果要讓新插入的item成為第一個子節(jié)點或者在第一行,index就設(shè)為0。如果是第二個子節(jié)點或者第二行,就是設(shè)置index=1。如果在最末端插入item,就設(shè)置index='end'
(3)iid
如果沒有賦值,就使用系統(tǒng)自動生成的id。如果輸入了id,必須保證與現(xiàn)有的id不重復。否則系統(tǒng)會自動生成id。
(4)**kw
設(shè)置插入item的屬性。支持的屬性有:

選項 含義
image 顯示圖像
open 針對樹形結(jié)構(gòu),確認插入的item是打開還是折疊狀態(tài)。True打開,F(xiàn)alse為折疊。
tags 為新插入的item設(shè)置tag標簽
text 顯示文字
values 在表格結(jié)構(gòu)中,要顯示的數(shù)值。這些數(shù)值是按照邏輯結(jié)構(gòu)賦值的,也就是按照columns設(shè)定的列次序來賦值。如果輸入的個數(shù)少于columns指定列數(shù),則插入空白字符串

在前面章節(jié)的例子中已經(jīng)使用了insert,可以參考。

1.17 item(item, option=None, **kw)

item()方法有3種功能:
(1)只有item參數(shù)
返回item有關(guān)數(shù)據(jù)字典。數(shù)據(jù)字典的鍵值(key)包括:
text,image,open,tags以及values。values就是item參數(shù)指定的節(jié)點的內(nèi)容。

tv.item('I002')

結(jié)果:
{'text': '', 'image': '', 'values': ['李四', 100, 92, 90], 'open': 0, 'tags': ''}

(2)輸入item和option參數(shù)
返回item指定節(jié)點中由option指定的選項值。比如:

tv.item('I002',option='values')

就是返回節(jié)點的內(nèi)容。見前一節(jié)有關(guān)返回數(shù)據(jù)字典的鍵值。

(3)item和kw
使用
kw中的鍵值對(就是選項值)修改item指定的節(jié)點的相關(guān)選項。最常用的是使用values來修改節(jié)點的內(nèi)容。
比如:

tv.item('I002',values=('李峰','90','88','66'))

結(jié)果:

在這里插入圖片描述在這里插入圖片描述

可以看到第二行的數(shù)據(jù)被修改了。

1.18 move(item, parent, index)

move()方法有兩種作用:
(1)將detach的item重新顯示(reattach)
(2)移動item指定的節(jié)點到parent的子節(jié)點中,位置由index指定
需要注意的是,不能把父節(jié)點移動到子節(jié)點下面。因為這是無法實現(xiàn)的。還有就是index的值如果是0或者負數(shù),則表示item的位置在parent的第一個子節(jié)點。如果index的值大于或者等于子節(jié)點的總數(shù),則表示把item放置在子節(jié)點的最后一個。

1.19 next(item)

(1)如果item不是當前父節(jié)點的最后一個子節(jié)點,則返回下一個子節(jié)點
(2)如果item已經(jīng)是最后一個子節(jié)點,返回空字符串
(3)如果是表格類型的Treeview,則返回下一item對象?;蛘叻祷乜兆址绻鹖tem已經(jīng)是最后一個item對象。

1.20 parent(item)

樹形結(jié)構(gòu)的Treeview,該方法返回父節(jié)點的ID;如果是表格類型的Treeview,則返回空字符串。

1.21 prev(item)

與next()類似,不過是返回前一個item的ID。

1.22 see(item)

保證item指定的節(jié)點在Treeview控件中可見。針對有比較多節(jié)點的情況下,此方法可以讓希望顯示的節(jié)點快速顯示在窗口中而不需要用滾動條的去滾動。

1.23 selection(items=None)

返回當前選定的節(jié)點的iid。

1.24 selection_set(items)

選中item指定的節(jié)點。items可以是單個節(jié)點的ID,或者多個節(jié)點ID的元組。

import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('320x240')
tk.Label(root,text='成績表').pack()
area=('#','數(shù)學','語文','英語')
ac=('all','m','c','e')
data=[('張三','90','88','95'),
      ('李四','100','92', '90'),
      ('王二','88','90', '91')
      ]
tv=ttk.Treeview(root,columns=ac,show='headings',
                height=5)
for i in range(4):
    tv.column(ac[i],width=70,anchor='e')
    tv.heading(ac[i],text=area[i])
tv.pack()
for i in range(3):
    tv.insert('','end',values=data[i])
def selection():
    tv.selection_set('I001','I002')
ttk.Button(root,text='Selection',command=selection).pack()
root.mainloop()

結(jié)果:

在這里插入圖片描述

1.25 selection_remove(items)

與selection_set()相反,selection_remove()是把items指定的節(jié)點從選擇中移除。

1.26 selection_add(items)

將items指定所有節(jié)點加入到選中的集合中。那么selection_add()與selection_set()的區(qū)別是什么?selection_set相當于重置選擇的節(jié)點,不管以前是如何選擇的,執(zhí)行selection_set后,只有selection_set中輸入的items節(jié)點會被選中。而selection_add()對當前的選選擇沒有影響,只是把items指定的節(jié)點添加到選擇的集合中。

1.27 selection_toggle(items)

該方法的作用相當于數(shù)字電路中的非門,就是已經(jīng)選中的節(jié)點變?yōu)闉檫x中,沒有選中的節(jié)點變?yōu)檫x中。

1.28 set(item, column=None, value=None)

(1)只有item
返回指定節(jié)點(行)的數(shù)據(jù)字典。字典的鍵值是columns屬性定義的列的別名,而對應(yīng)的數(shù)值就是節(jié)點(行)的內(nèi)容。此種用法相當于獲取指定節(jié)點的行內(nèi)容與列別名信息。

(2)只有item和column
返回由item和column指定的單元格的內(nèi)容。column的取值是別名。

tv.set('I002',column='all')

(3)item,column和value
如果三個參數(shù)都有值,那么會修改由item和column指定的單元格的內(nèi)容。

tv.set('I002',column='all',value='abc')

1.29 tag_bind( tagname, sequence=None, callback=None)

將tagname指定的tag與sequence指定事件綁定,回調(diào)函數(shù)由callback設(shè)定。需要注意的是,一個tag可能與多個節(jié)點相關(guān)。也就是說,可能會有多個item與事件綁定。

import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('320x240')
tk.Label(root,text='成績表').pack()
area=('#','數(shù)學','語文','英語')
ac=('all','m','c','e')
data=[('張三','90','88','95'),
      ('李四','100','92', '90'),
      ('王二','88','90', '91')
      ]
tv=ttk.Treeview(root,columns=ac,show='headings',
                height=5)
for i in range(4):
    tv.column(ac[i],width=70,anchor='e')
    tv.heading(ac[i],text=area[i])
tv.pack()
for i in range(3):
    tv.insert('','end',values=data[i],tags=str(i))
def tb(*args):
    print(*args)
def bind():
    tv.tag_bind('1',sequence='<Button-1>',
                callback=tb)
ttk.Button(root,text='Bind',command=bind).pack()
root.mainloop()

結(jié)果:
<ButtonPress event state=Mod1 num=1 x=131 y=61>

說明:給插入的數(shù)據(jù)每一行都設(shè)定一個tag,比如第一行的tag是'0',等等。然后通過tag_bind()方法綁定鼠標左鍵事件。

1.30 tag_configure( tagname, option=None, **kw)

與item()方法有些類似,也是有三種功能:
(1)只有tagname
返回tagname指定tag的選項/屬性數(shù)據(jù)字典。比如tv.tag_configure(‘2')的返回值為:
{‘text': ‘', ‘image': ‘', ‘a(chǎn)nchor': ‘', ‘background': ‘', ‘foreground': ‘', ‘font': ‘'}

(2)tagname和option
返回tagname指定的tag中option指定的屬性值。比如option='anchor',則返回anchor屬性值。

(3)tagname和kw
對tagname指定的tag,使用kw中的參數(shù)設(shè)置有關(guān)屬性。屬性值見(1)中的說明。

1.31 tag_has(tagname, item=None)

(1)只有tagname
返回所有與tagname指定的tag有關(guān)的子節(jié)點。

(2)tagname和item
如果item指定的子節(jié)點的有tagname指定的tag,則返回True,否則返回False。判斷tag是否存在。

到此這篇關(guān)于Python tkinter 樹形列表控件(Treeview)的使用方法的文章就介紹到這了,更多相關(guān)Python tkinter 樹形列表內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • python字符串替換示例

    python字符串替換示例

    這篇文章主要介紹了python字符串替換示例,需要的朋友可以參考下
    2014-04-04
  • Python實現(xiàn)單詞翻譯功能

    Python實現(xiàn)單詞翻譯功能

    這篇文章主要為大家詳細介紹了Python實現(xiàn)單詞翻譯功能,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-06-06
  • django解決訂單并發(fā)問題【推薦】

    django解決訂單并發(fā)問題【推薦】

    這篇文章主要介紹了django解決訂單并發(fā)問題,本文給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下
    2019-07-07
  • Python利用imshow制作自定義漸變填充柱狀圖(colorbar)

    Python利用imshow制作自定義漸變填充柱狀圖(colorbar)

    這篇文章主要介紹了Python利用imshow制作自定義漸變填充柱狀圖(colorbar),文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2020-12-12
  • python如何查看安裝了的模塊

    python如何查看安裝了的模塊

    在本篇文章里小編給大家分享的是一篇關(guān)于python查看安裝了的模塊的方法,需要的朋友們可以學習下。
    2020-06-06
  • 基于Pytorch SSD模型分析

    基于Pytorch SSD模型分析

    今天小編就為大家分享一篇基于Pytorch SSD模型分析,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-02-02
  • python導出chrome書簽到markdown文件的實例代碼

    python導出chrome書簽到markdown文件的實例代碼

    python導出chrome書簽到markdown文件,主要就是解析chrome的bookmarks文件,然后拼接成markdown格式的字符串,最后輸出到文件即可。下面給大家分享實例代碼,需要的朋友參考下
    2017-12-12
  • python如何正確的操作字符串

    python如何正確的操作字符串

    Python是一種知道如何不妨礙你編寫程序的編程語言。它易于學習,功能強大,足以構(gòu)建Web應(yīng)用程序并自動化無聊的東西。本文是對常用字符串操作進行了詳細的總結(jié)分析,希望對您有所幫助。
    2021-06-06
  • 跟老齊學Python之畫圈還不簡單嗎?

    跟老齊學Python之畫圈還不簡單嗎?

    畫圈?換一個說法就是循環(huán)。循環(huán),是高級語言編程中重要的工作?,F(xiàn)實生活中,很多事情都是在循環(huán),日月更迭,斗轉(zhuǎn)星移,無不是循環(huán);王朝更迭,尋常百姓,也都是循環(huán)。
    2014-09-09
  • python_tkinter事件類型詳情

    python_tkinter事件類型詳情

    這篇文章主要介紹了python_tkinter事件詳情,文章基于python_tkinter事件相關(guān)資料分享的內(nèi)容有事件綁定函數(shù),事件對象等相關(guān)自資料,需要的小伙伴可以參考一下
    2022-03-03

最新評論