[Solved] Where to get the positions of the last item in the Listbox (python and tkinter)?


You can get the numerical index of the last item with the documented index command, passing in the special string “end”:

last_index = the_listbox.index("end")

To get the value of the last item you can use “end” in the get method as well:

last_value = the_listbox.get("end")

To make sure that the last item in the listbox is visible, you can pass “end” to the see method:

the_listbox.see("end")

1

solved Where to get the positions of the last item in the Listbox (python and tkinter)?