Dear list,

I got an array of dictionaries, that I want to add to a GTKListStore,
that is displayed an a treeview.

This is very slow. I already replaced the liststore.append by
liststore.insert, which is much much faster.
But still, filling the 10.000 values takes about 50 seconds.

Is there any cool mapping function, to push the array to the liststore?
I used a for loop to iterate over the array...
I also tried while an to pop the array elements...

It is something like this:

data: array of dictionaries

data = array( { 'v1' : 'something', 'v2': 'something else' } ,
              { 'v1' : 'another',   'v2': 'something completely diff' }
                )
 

for d in data:
   self.liststore.insert( 0, ( d.get("v1"), d.get("v2") ....))


...is there a better way than doing a for loop?
...or a way to not have to interate over the 10.000 dicts?

...or is there a cool reading on performance tuning pyton?

Kind regards
Cornelius



Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to