thelost
thelost

Reputation: 705

How to get listbox elements in a list? wxpython

I am using wxpython and I would like to get all the elements in the listbox and returned in a list.

(Almost like the Oposite of the "Set" function)

Example:

Listbox has Dog Cat Fun

The function should return ["Dog","Cat","Fun"]

Thanks

Upvotes: 2

Views: 656

Answers (2)

吳強福
吳強福

Reputation: 373

.GetItems()

This function can get all elements in your Listbox as a list.

Upvotes: 1

BenH
BenH

Reputation: 2120

I think there's a GetStrings() function.

listBoxList = yourListBox.GetStrings()

Upvotes: 1

Related Questions