[C++-sig] using the same module in different files

Stefan Seefeld seefeld at sympatico.ca
Mon Apr 10 22:07:50 CEST 2006


Abhi wrote:

> I want both these files to expose methods in the same module, ie, I want to 
> "semantically" use BOOST_PYTHON_MODULE(common) for both these files, so 
> that all the methods exposed from boost_A.cpp and boost_B.cpp get imported 
> by doing
> 
>>> import common
>>> a = common.A()
>>> b = common.B()
> 
> 
> Is this possible?

Wouldn't it be simpler to integrate both from within python, using

# inside common.py
import A, B


?

Regards,
		Stefan



More information about the Cplusplus-sig mailing list