[C++-sig] Re :Re: back-embedding... is this possible?
roman.yakovenko at gmail.com
Mon Jul 10 14:11:06 CEST 2006
On 7/10/06, blairs at free.fr <blairs at free.fr> wrote:
> I can create the instance in python with
> PyRun_String("a =A()");
> then handle a in C++ with
> A& a = extract<A&>(main_namespace["a"]);
> but I don't get it from this tutorial how to create the instance in c++ then
> handle it in python
boost::shared_ptr<A> a( new A() );
boost::python::object py_a( a );
Now, I think, you have to inject py_a to appropriate scope.
C++ Python language binding
More information about the Cplusplus-sig