The code is as follows (see code 5.03—view.py):
def empty_play_list(self): self.model.empty_play_list() self.list_box.delete(0, END)
This completes our third iteration. In this iteration, we saw how to work with the Listbox widget. In particular, we saw how to add items to the Listbox widget, select a particular item from the Listbox widget, and delete one or more items from it.
You now have a playlist where you can add and delete items using the four buttons at the bottom-left corner of the audio player.