Boost logo

Boost Users :

From: François Duranleau (duranlef_at_[hidden])
Date: 2006-09-04 13:40:48


On Mon, 4 Sep 2006, Qinfeng(Javen) Shi wrote:

> Dear all,
>
> I know how to wrap a single file to python.
> I have several files and I don't want to rewrite them into a large single
> file.
> How to wrap them to python?

One possible way to do this manually:

file1.hpp:

export_stuff_from_file1() ;

file1.cpp:

void export_stuff_from_file1()
{
     // Do your Boost.Python calls here for your stuff corresponding to
     // this file
}

// Same for file2, file3, etc.

main_module_file.cpp:

#include "file1.hpp"
//...

BOOST_PYTHON_MODULE( your_module )
{
     export_stuff_from_file1() ;
     // ...
}

-- 
François Duranleau
LIGUM, Université de Montréal

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net