python ttk treeview sort numbers

前端 未结 4 1984
你的背包
你的背包 2020-12-06 23:26

I\'m trying to use the ttk.Treeview sort function illustrated in the answer to this question (Tk treeview column sort) and it works just fine for strings like \'abc\', \'bcd

4条回答
  •  有刺的猬
    2020-12-06 23:42

    If someone is checking in 2020 and need to include float as well, then use this

    l.sort(key=lambda t: float(t[0]), reverse=reverse)
    

提交回复
热议问题