Duplicate words in a listbox Duplicate words in a listbox tkinter tkinter

Duplicate words in a listbox


Your problem is not in the listbox, but in the way you save your words in XML in save_all(self). To properly reset the tree, you should replace:

for xNode in tree.findall('Words'):    tree.remove(xNode)

with

for xNode in tree.getroot().findall('Word'):    tree.getroot().remove(xNode)