Reputation: 63
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()
Upvotes: 6
Views: 12137
Reputation: 3698
To get the number of items in a listbox, you can do:
listbox.size()
Upvotes: 16