filmov
tv
Python and Tkinter - Listbox, how to add and delete items

Показать описание
How to add items and how to delete them into a listbox using Python and Tkitner
New post with an updated code
The code with chance to save data
import tkinter as tk
root = tk.Tk()
def retrievedata():
global list_data
list_data = []
try:
for f in file:
print(list_data)
except:
pass
def clicked():
global list_data
def delete():
global list_data
list_data = []
def delete_selected():
global list_data
try:
#print(index)
except:
pass
def quit():
global root
for d in list_data:
# LISTBOX
content = tk.StringVar()
entry = tk.Entry(root, textvariable=content)
button = tk.Button(root, text="Add Item", command=clicked)
button_delete = tk.Button(text="Delete", command=delete)
button_delete_selected = tk.Button(text="Delete Selected", command=delete_selected)
listbox = tk.Listbox(root)
bquit = tk.Button(root, text="Quit and save", command=quit)
retrievedata()
New post with an updated code
The code with chance to save data
import tkinter as tk
root = tk.Tk()
def retrievedata():
global list_data
list_data = []
try:
for f in file:
print(list_data)
except:
pass
def clicked():
global list_data
def delete():
global list_data
list_data = []
def delete_selected():
global list_data
try:
#print(index)
except:
pass
def quit():
global root
for d in list_data:
# LISTBOX
content = tk.StringVar()
entry = tk.Entry(root, textvariable=content)
button = tk.Button(root, text="Add Item", command=clicked)
button_delete = tk.Button(text="Delete", command=delete)
button_delete_selected = tk.Button(text="Delete Selected", command=delete_selected)
listbox = tk.Listbox(root)
bquit = tk.Button(root, text="Quit and save", command=quit)
retrievedata()
List Boxes - Python Tkinter GUI Tutorial #61
Learn Python tkinter GUI listboxes easy 📋
Python GUI Tutorial - 25 - Listbox - part 1 | Tkinter
List Box and Multi-line Text Box in Python GUI tkinter
ListBox In Tkinter| Python Tkinter GUI Tutorial In Hindi #21
Python GUI with Tkinter - Listbox widget + Advance Frames - 22/30
Python Tkinter - 11 - Listbox Explained
Listbox in Tkinter | Python Tkinter GUI Tutorial part9
Python: how to get the items of a listbox in tkinter
Add an item to a ListBox - tkinter- Python 3
Python Programming 89 - Tkinter Listbox - Display a List of Data
Python and Tkinter - Listbox, how to add and delete items
Python - Listbox Widget
Python Tutorial #95 – Tkinter – Listbox
Python GUI TKinter | ListBox
Tkinter tutorial for beginners #5: Combobox, Listbox
Python: TKinter Listbox Tutorial
Python GUI with Tkinter and Listbox
Python: using Tkinter: listbox part 1
Tkinter - Listbox - Curso de Python #74
tkinter listbox: how to add a scrollbar - python 3
Move one item from a listbox to an other- Python3: Tkinter
tkinter listboxes -- Python GUI Programming Tutorial Part 8
tkinter listbox: how to get the value of a selected item
Комментарии