Learn Python tkinter GUI listboxes easy 📋

preview_player
Показать описание
Python tkinter listbox Listbox GUI tutorial for beginners

#Python #tkinter #listbox #Listbox #GUI #tutorial #beginners
Рекомендации по теме
Комментарии
Автор

# listbox = A listing of selectable text items within it's own container

def submit():

food = []

for index in listbox.curselection():
food.insert(index, listbox.get(index))

print("You have ordered: ")
for index in food:
print(index)

def add():
listbox.insert(listbox.size(), entryBox.get())


def delete():
for index in
listbox.delete(index)



from tkinter import *

window = Tk()

listbox = Listbox(window,
bg="#f7ffde",
font=("Constantia", 35),
width=12,
selectmode=MULTIPLE)
listbox.pack()

listbox.insert(1, "pizza")
listbox.insert(2, "pasta")
listbox.insert(3, "garlic bread")
listbox.insert(4, "soup")
listbox.insert(5, "salad")



entryBox = Entry(window)
entryBox.pack()

frame = Frame(window)
frame.pack()

submitButton = Button(frame, text="submit", command=submit)
submitButton.pack(side=LEFT)

addButton = Button(frame, text="add", command=add)
addButton.pack(side=LEFT)

deleteButton = Button(frame, text="delete", command=delete)
deleteButton.pack(side=LEFT)

window.mainloop()

BroCodez
Автор

Best video in the whole YouTube. Not even kidding. Thanks a ton

davidcalebpaterson
Автор

Best channel yet, this is the best pre-course material ever. This smokes everything except coursera but in ways still out does coursera

jhassee
Автор

thank you for such a great tutorial :)

googlegoogle
Автор

Helpful and especially direct to the subject. I am a fan. Thank you.

toddlawrimore
Автор

great video! loved coding along in this one

hamzazad
Автор

Nicely explained. But I did not see the usual comments added at the end of the code lines in this.

paulfernando
Автор

you are the GOAT of coding,
love from earth 🌏

_zitsu_k
Автор

Your are best bro ....love from bangladesh

lost_lyrics
Автор

please can you make a guidance video of how to get in freelancing with coding

_zitsu_k
Автор

Is there any way to make the columns resizable by clicking and dragging on top box in a column? (like you can most other prorgrams' listboxes)

JohnSmithZen
Автор

can somebody help me how can I put exception handling when user did not select anything from the listbox but did click the delete button?

mintv
Автор

how many centuries it takes to be like you bro?

_zitsu_k
Автор

If .size() returns the size of the list, how come it doesn't replace the latest entry's index when used in .insert()?
Apparently I can use END for the first argument of .insert() to add a new entry at the end of the list without weirding myself out.

AzzRushman
Автор

Can someone explain the reversed thing, thats the only thing i find confusing.

sidtheepic
Автор

can somebody help me how can I put exception handling when user did not select anything from the listbox but did click the delete button?

mintv
Автор

can somebody help me how can I put exception handling when user did not select anything from the listbox but did click the delete button?

mintv
Автор

can somebody help me how can I put exception handling when user did not select anything from the listbox but did click the delete button?

mintv
Автор

can somebody help me how can I put exception handling when user did not select anything from the listbox but did click the delete button?

mintv