call python from c -> pass and return arrays/lists

Pieter pieter.cogghe at gmail.com
Thu Apr 10 05:58:14 EDT 2008


Hi all,

I'm trying to call a python function from c. I need to pass an
2D-array to python and the python function returns a 2D-list back to
c. I googled arround and I found how to pass ints/strings/... back and
forth, but didn't find anything on passing arrays.

For an int it's as simple as this:

PyArg_Parse(ret,"i#", &my_long);

But I hacve no idea how to parse python lists to a c-array?

thanks a lot,

Pieter
-- 
Pieter Cogghe
Ganzendries 186
9000 Gent
0487 10 14 21



More information about the Python-list mailing list