title: How to wrap a python class into a C++ class?
body: <p>I have a python class which implements a given functionality, eg the file <em>Test_script.py</em> is:</p>
  
  <pre><code>class Test(object):
      def __init__(self,name):
          self.name=name
      def f1(self,n):
          return n**2
      def f2(self,n,m):
          return n+m
      def f3(self,word):
          print word
  </code></pre>
  
  <p>How can I build a C++ class which simply wraps this class and all the functions so that this class can in turn by used by other C++ classes/code?
  Is boost::python helpful in providing some shortcuts?</p>
  
  <p><strong>Why is this relevant?</strong>
  Because there can be concrete use cases for which it is much faster and easier to implement a given functionality in python since lots of well tested and documented modules can be reused (e.g. parsing, numpy functions, ...) rather than doing it from scratch in C++. The above class is a toy problem, once it is clear how to wrap/embed this in C++ it will be easy to deal with more complex functionality.</p>
  
  <p>Thx</p>