Question concerning array.array and C++

Fabio Auslieferator at gmx.net
Wed Nov 5 10:53:12 EST 2008


Hi All,
I have a question concerning the use of array.array inside of C++ code I 
wrote.

I am working with _big_ data files but some entries in these files are
usually bounded say between -5 to 40. Returning a Python list makes no 
sense. In Python I always work with the array.array module which does 
the trick. But now that I wrote my own C++ module for some preprocessing 
I need the return array.array objects.

Consider the object

array.array('c',[40,40,40])

Can I create such an object from within the C++ layer and pass it to the 
Python layer?

I already looked at arraymodule.c and tried to link the arraymodule.o 
file to my code but then I have to mess around with extern "C" and the 
like and it gets really messy.

Any help would be great!

Fabio




More information about the Python-list mailing list