[C++-sig] How to export arrays from C(++) to python using boost

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Mon Feb 9 14:59:50 CET 2004


--- "Shukla, Nitin (Export)" <nitin.shukla at pw.utc.com> wrote:
> I am working on an application where an array of ints and floats are to 
> exported from C++ to Python using boost::python. 
> 
> As I am newbie to boost python, I couldn't find any documentation or 
> working example that satisfies the above requirement. Can someone help 
> me out??

Wrapping arrays is possible in several different ways. There isn't "the one"
universal solution. Here are some links to get you started:

To learn about the choice of creating a new Python types for your arrays vs.
converting to and from regular Python tuples:

http://www.boost.org/libs/python/doc/v2/faq.html#question2

How to use the "indexing suite" that comes with Boost.Python (1.31.0 release):

http://www.boost.org/libs/python/doc/v2/indexing.html

Some nice general examples that predate the indexing suite:

http://www.python.org/cgi-bin/moinmoin/boost_2epython_2fStlContainers

Raoul Gough is working on a new implementation of the indexing suite. Look in
the archieve of this list to learn more about his efforts.

Ralf


__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html




More information about the Cplusplus-sig mailing list