Is there a way to sort the entries in a Tk Treeview by clicking the column? Surprisingly, I could not find any documentation/tutorial for this.
This did not work in python3. Since the Variable was passed by reference, all lambdas ended up refering to the same, last, element in columns.
This did the trick for me:
for col in columns:
treeview.heading(col, text=col, command=lambda _col=col: \
treeview_sort_column(treeview, _col, False))