title: Call method of python class from C++ code
body: <p>For example let us consider <code>python</code> class with the following structure in file<code>mult.py</code>.</p>
  
  <p><code>mult.py</code></p>
  
  <pre><code>class Mult: 
        def __init__(self, first, second):
              self.a = first 
              self.b = second 
  
        def multiply(self):
              c = self.a*self.b
              print 'The result of', self.a, 'x', self.b, ':', c
              return c
  </code></pre>
  
  <p><strong>How could we call <code>multiply</code> method from class above in <code>C++</code> Code?</strong> (But without <code>PyRun_SimpleString()</code> function)</p>
  
  <p><code>main.cpp</code></p>
  
  <pre><code>#include&lt;python2.7/Python.h&gt;
  #include &lt;boost/python.hpp&gt;
  
  int main()
  {
       Py_Initialize();
       int a {10};
       int b {5};
       ... CODE HERE (a*b using python function)
       Py_Finalize();
  }
  </code></pre>
  
  <p>I was looking a solution in <code>Cython</code> and <code>boost.python</code> but could not find it.</p>
  
  <p>Additional links:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/37577676/using-python-objects-in-c">First link</a></li>
  <li><a href="https://stackoverflow.com/questions/5055443/boost-python-how-to-pass-a-c-class-instance-to-a-python-class">Second link</a></li>
  </ul>