Mar-20-2021, 02:23 PM
(This post was last modified: Mar-20-2021, 02:23 PM by deanhystad.)
Searching works fine as far as I can tell. What do you think is wrong?
You get the index error when doing this:
You get the index error when doing this:
index = list.curselection()[0]And there is nothing selected in the Listbox. Since this is something that can legitimately happen, you need to protect against it.
def get_selected_row(event): global selected_row index = list.curselection() if not index: return selected_row = list.get(index[0]) ...By the way, list is a built-in Python function and should not be used as a variable name.