Fast array exchange between python and C++

Ja'zz ja at zz.emsmp.fr
Wed Jan 23 05:46:56 EST 2002


What is the recommended way to transfer arrays of numerical data from
python to a C/C++ library and vise-versa? My current approach is to
define the array in a C++ class, write put and get methods with indexes
and use SWIG (-shadow) to access the methods in python. It works but
creates loads of overhead.

However, at this point, efficiency becomes a vital concern. How to I
exchange an array of simple datatypes (doubles, integers and strings),
such that they are read/write at both sides, with a minimum of overhead?

I am a newbie to python programming. Any hints are very much
appreciated.
-Jan.
--
Jan van der Lee -- vanderlee at cig dot ensmp dot fr



More information about the Python-list mailing list