using boost to return list

Neil Hodgson nyamatongwe+thunder at
Sat Jun 4 23:59:17 CEST 2005


> 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, 	
	for (int i=0;i<lenRet;i++) {
	delete []characters;
	return result;


More information about the Python-list mailing list