How to get item list from wxpython ListBox(如何从 wxpython ListBox 获取项目列表)
问题描述
是否有一个方法可以返回 wxPython listBox 中包含的项目列表?
Is there a single method that returns the list of items contained in a wxPython listBox?
我似乎在文档中的任何地方或任何地方都找不到任何东西.我能想到的就是将选择设置为所有项目,然后获取选定的项目,尽管这似乎是一种丑陋的迂回方式来做一些应该简单的事情.
I cant seem to find anything anywhere in the documentation or anywhere for that matter. All that I can think to do is to set the selection to all of the items and then get the selected items, though seems like an ugly roundabout way of doing something that should be simple.
更新:
正如 jeremy 所指出的,这样做的方法是使用 GetStrings()
As pointed out by jeremy the way to do this is with GetStrings()
例如
listBoxList = yourListBox.GetStrings()
推荐答案
wx.ListBox
派生自 wx.ControlWithitems
.我认为 GetStrings() 是您所需要的.
wx.ListBox
is derived from wx.ControlWithitems
. I think GetStrings() is what you need.
这篇关于如何从 wxpython ListBox 获取项目列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何从 wxpython ListBox 获取项目列表


- 我如何透明地重定向一个Python导入? 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- YouTube API v3 返回截断的观看记录 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01