Python 3 - Getting amount of items in Listbox widget

Viewed 8808

Is there a way to retrieve a value of the amount of items in a Listbox widget? Such as len() is used for a list, but it cannot be used for Listbox as it gives the following error:

if len(listbox)==0:
TypeError: object of type 'Listbox' has no len()
1 Answers

To get the number of items in a listbox, you can do:

listbox.size()
Related