How to clear an entire Treeview with Tkinter

katze picture katze · Apr 2, 2014 · Viewed 29.7k times · Source

My program uses a ttk.Treeview as a table and fills it with many numbers.

I want to clear the ttk.Treeview when I press a button in the window.

Is there a simple way to clear the ttk.Treeview?

Thanks.

Answer

James Adam picture James Adam · Nov 21, 2014

Even simpler:

tree.delete(*tree.get_children())