SWIG char** to Python list

C

Chris

Hi

I have a C function that builds a list of null terminated strings:
void buildStringList(char **asStrings, int n);
The number of elements in the list is given in input.

I'd like to have this function available in Python.
I use SWIG but I'm a complete newbie with it.
I've only found an example to convert a Python list to C char**
http://www.swig.org/Doc1.3/Python.html#Python_nn59

I naively replaced typemap(in) by typemap(out) but it doesn't work :
TypeError: argument number 1: a 'char **' is expected, 'list([])' is
received

Do I have to learn more of SWIG or is there a simple way to make my C
function fill a list of Python objects?

Regards
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top