How would I access the string that is in the [1] position of a tuple at a given index of a listbox. What I'm trying to do is something like this:

a=Lb1.curselection()[1]
    a=int(a)
    print(Lb1[a])

Lb1 is obviously the listbox. This particular attempt claims 1 is out of range "although I know it has a string in that position". With [0] in the position when it gets to Lb1[a] it claims, can't convert type int to str implicitly, however I wouldn't want to do that, because, futilely, I'm trying to index it.

That was extremely helpful. However I'm still having a hard time figuring out how to use the -autocomplete option and if I can make commands directly to the entry widget of the combobox separately.

hmm, would I need to do multi-threading to have a loop continuously looking through what's in the entry field of the combobox? I really like the listbox that drops when you take a moment to think of what you're trying to type in tkinter, specifically I like how it goes directly to the closest match to what you've typed in. That's not the autocomplete is it?

Edited 5 Years Ago by pyguy62: n/a

No, event loop takes care of that, above code hooked to key release event.Then if you need repeated activity you can use after method of a widget. See the second link (maybe 2to3 script can prepare it for Python3, by the way you can install both Python2 and Python3 without too much confusion).

This article has been dead for over six months. Start a new discussion instead.