using boost to return list

G

GujuBoy

i am trying to make a "cpp" file which will make an array and pass it
to python as a list.

how is this possible...i am using BOOST...please can someone point me
at some examples

thanks
 
N

Neil Hodgson

GujuBoy:
i am trying to make a "cpp" file which will make an array and pass it
to python as a list.

how is this possible...i am using BOOST...please can someone point me
at some examples

This returns a list when called from Python.

static list retrieval_as_list(SplitText &self, int position,
int retrieveLength) {
list result;

int *characters = new int[retrieveLength];
int lenRet = self.RetrieveUTF32(position, characters,
retrieveLength);
for (int i=0;i<lenRet;i++) {
result.append(characters);
}
delete []characters;
return result;
}

Neil
 

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

Staff online

Members online

Forum statistics

Threads
474,241
Messages
2,571,219
Members
47,849
Latest member
RoseannKoz

Latest Threads

Top