How to clear Tkinter ListBox Python How to clear Tkinter ListBox Python tkinter tkinter

How to clear Tkinter ListBox Python


Depending on how you imported tkinter you may have to put end in quotations Try:

  self.listNodes.delete(0,'end')

you can also use:

self.listNodes.delete(0,tk.END)


Replace:

self.listNodes.delete(0,END)

with:

self.listNodes.delete('0','end')

END is a variable of module, which suggests either a wildcard(from tkinter import *) import or from tkinter import END was supposed to be used.


You can use this is you imported tkinter as:

import tkinter as tkself.listnodes.delete(0, tk.END)

Or you can do:

from tkinter import *self.listnodes.delete(0, END)