Number of items in wx.ListBox/wx.CheckListBox

Hi Everyone,

I can’t seem to find anywhere how to either call a “check all” or the number of items there are in a wx.CheckListBox. Either would do, as I can use a for loop to check/decheck each item as needed, though a simple method would be easier.

Any help would be appreciated.

  • Josh
···


Joshua Henderson
+61 449 128 074
joshhendo@gmail.com

wx.CheckListBox.GetCount() ?

···

2008/8/10 Joshua Henderson joshhendo@gmail.com

Hi Everyone,

I can’t seem to find anywhere how to either call a “check all” or the number of items there are in a wx.CheckListBox. Either would do, as I can use a for loop to check/decheck each item as needed, though a simple method would be easier.

Any help would be appreciated.

  • Josh


Joshua Henderson
+61 449 128 074
joshhendo@gmail.com


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

I am actually looking to find if the index exist rather than doing a lookup on the value:

eg if lista[3] exist

···

On Sun, Aug 10, 2008 at 10:18 AM, raffaello barbarossa.platz@gmail.com wrote:

lista = 4, ‘cdog’, 88, -3.14
88 in lista # (returns True)

Hello,

···

On Aug 10, 2008, at 2:22 PM, Wesley Nitsckie wrote:

On Sun, Aug 10, 2008 at 10:18 AM, raffaello barbarossa.platz@gmail.com wrote:

lista = 4, ‘cdog’, 88, -3.14
88 in lista # (returns True)

I am actually looking to find if the index exist rather than doing a lookup on the value:

eg if lista[3] exist

You might want to read some of the python docs (http://python.org/doc/)).

if len(lista) > 3:

print “list has index 3”

Not to discourage but these types of questions are more appropriate to ask on one of the python mailing lists (http://www.python.org/community/lists/)).

Cody

n = lista.Count
if n >= 3: lista[3] exists

···

2008/8/10 Wesley Nitsckie wesleynitsckie@gmail.com

On Sun, Aug 10, 2008 at 10:18 AM, raffaello barbarossa.platz@gmail.com wrote:

lista = 4, ‘cdog’, 88, -3.14
88 in lista # (returns True)

I am actually looking to find if the index exist rather than doing a lookup on the value:

eg if lista[3] exist


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Wesley Nitsckie wrote:

I am actually looking to find if the index exist rather than doing a lookup on the value:

eg if lista[3] exist

Just in case you're saying 'list' where you mean to say 'dict', take a look at this:

>>> notList = {
  1: 'one',
  2: 'two',
  6: 'six',
  10: 'ten',
  }
>>> 2 in notList
True
>>> 3 in notList
False