애플리케이션에 항목 목록을 표시하기 위해 Tkinter는 Listbox 위젯을 제공합니다. 항목 목록을 세로로 만드는 데 사용됩니다. 특정 목록 상자 항목의 텍스트를 변경하려면 먼저 listbox.curselection()을 반복하여 항목을 선택해야 합니다. 삭제 후 새 항목을 삽입하십시오. 목록에 항목을 삽입하려면 listbox.insert(**items)를 사용할 수 있습니다.
예시
# Import the required libraries
from tkinter import *
from tkinter import ttk
# Create an instance of tkinter frame or window
win=Tk()
# Set the size of the window
win.geometry("700x350")
# Create a Listbox widget
lb=Listbox(win)
lb.pack(expand=True, fill=BOTH)
# Define a function to edit the listbox ite
def edit():
for item in lb.curselection():
lb.delete(item)
lb.insert("end", "foo")
# Add items in the Listbox
lb.insert("end","item1","item2","item3","item4","item5")
# Add a Button To Edit and Delete the Listbox Item
ttk.Button(win, text="Edit", command=edit).pack()
win.mainloop() 출력
위의 코드를 실행하면 항목 목록이 포함된 창이 표시됩니다.

이제 목록에서 항목을 선택하고 "편집"을 클릭하십시오. 목록에서 선택한 항목을 편집합니다.
