On 12 Oct 2005 04:46:34 -0700, Java and Swing <[EMAIL PROTECTED]> wrote:
...
> ...my question is...in the c code, result is a pointer to an array of
> longs, how can I get the returned result to be a list or something
> similar to an array in Python?

RTFM. There are API functions to create an empty list [] and to append
objects to a list. PyList_something(), I think.

> ...I also have a function which returns a character array (denoted by a
> char *)...would it work the same as the previous question?

You might want to return this as a Python string, even if it's just random
octet data garbage. Depends on what that data really represents, but it's a
common idiom, and modules like struct and array expect their data to be
strings. Note that Python strings may contain NUL bytes.

/Jorgen

-- 
  // Jorgen Grahn <jgrahn@       Ph'nglui mglw'nafh Cthulhu
\X/                algonet.se>   R'lyeh wgah'nagl fhtagn!
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to