'How to select last row in ttk.treeview python?

    def row_selection(event = None):
        idlist = product_table.get_children()
        if idlist:
            product_table.selection_set(idlist[0])
            product_table.focus(idlist[0])
            product_table.focus_force()

This is the function I used to select the first row and how to select the last row of table.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source