n.utiu 0 Light Poster

Let's say we have this code :

#include <iostream>
#include <boost/python .hpp>
using namespace boost::python;

class A{
  void foo (void) {
    std::cout << "Hello World";
  }
};

BOOST_PYTHON_MODULE(hello) {
  class_ <A> ("A")
    .def("foo", A::foo);
}

and I have an object of type A named MyCPPClass and I want to make it public to python under the name MyPythonClass.

It there ant possible way to do this ? :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.