how do I iterate over a "gslist" in Python?
Let's say I get a glib gpointer
to a glib gslist
and would like to iterate over the latter, how would I do it?
I don't even know how to get to the gslist
with the gpointer
for starters!
Update: I found a workaround - the python bindings in this instance wasn't complete so I had to find another solution.
How is glib
exposed to Python in your application? Via SWIG, ctypes or something else?
You should basically use glib
's own functions to iterate over a list. Something like g_slist_foreach
. Just pass it the pointer and its other parameters to do the job. Again, this heavily depends on how you access glib
in your Python application.
精彩评论