469,645 Members | 1,189 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

SWIG char** to Python list

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
Jul 19 '05 #1
0 1474

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Andrew Collier | last post: by
3 posts views Thread by Lars Moastuen | last post: by
1 post views Thread by Java and Swing | last post: by
reply views Thread by Java and Swing | last post: by
3 posts views Thread by Java and Swing | last post: by
2 posts views Thread by ajikoe | last post: by
1 post views Thread by cody314 | last post: by
1 post views Thread by Sells, Fred | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.