Mar-20-2021, 05:23 PM
(This post was last modified: Mar-20-2021, 05:23 PM by deanhystad.)
You missed something. In my code I first ask for the selection.
I think you are doing this:
You did not answer my question about search. What do you think is wrong with the search function? I played around with it a bit and it appears to work very well.
index = list.curselection()If there is no selection, this returns an empty collection of some type ({} I think). Then I test if the selection is empty and return out of the function if it is.
if not index: returnIf index is not empty then I know it is save to ask for index[0].
I think you are doing this:
index = list.curselection()[0]This does nothing to protect against an index error, and generates an index error if you try to get "index[0]" because index is already an integer.
You did not answer my question about search. What do you think is wrong with the search function? I played around with it a bit and it appears to work very well.