开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜