title: Embedding python classes with different input function to C
body: <p>So, I have followed the instructions from <a href="http://www.codeproject.com/Articles/11805/Embedding-Python-in-C-C-Part-I?fid=220123&amp;df=90&amp;mpp=25&amp;noise=3&amp;prof=False&amp;sort=Position&amp;view=Quick&amp;spc=Relaxed&amp;fr=51#xx0xx" rel="nofollow">here.</a>
  I changed several parts because I want to access many classes in python codes with different functions.
  For learning, I modified the codes from the link above into:</p>
  
  <pre><code>class Multiply: 
  
      def __init__(self): 
           self.a = 6 
           self.b = 5 
  
     def multiply(self):
           c = self.a*self.b
           print 'The result of', self.a, 'x', self.b, ':', c
           return c
  
     def multiply2(self, a, b, d):
          e = a*b*d
          print 'The result of', a, 'x', b, 'x', d, e
          return e
  
  class Add:      
     def multiply3(self, k, l):
         f = k+l
         print 'The result of', k, '+', l, ':', f
         return f
  </code></pre>
  
  <p>And modified some parts of the call_class.c from <a href="http://www.codeproject.com/Articles/11805/Embedding-Python-in-C-C-Part-I?fid=220123&amp;df=90&amp;mpp=25&amp;noise=3&amp;prof=False&amp;sort=Position&amp;view=Quick&amp;spc=Relaxed&amp;fr=51#xx0xx" rel="nofollow">here</a> into</p>
  
  <pre><code>pValue = PyObject_CallMethod(pInstance, argv[3], "(iii)", arg[0], arg[1], arg[2]);
  </code></pre>
  
  <p>After compiling the call_function.c and try to call multiply3 from Add class, I got this error <code>TypeError: multiply3() takes exactly 3 arguments (4 given)</code></p>
  
  <p>I know it is because of that pValue, but I just think how could I call those classes with different functions input.
  I just wonder some solutions:
   1. Should I create more than one pValue?
  2. Should I create more than one call_class.c for calling different python classes (but no efficient at all)?</p>
  
  <p>Any suggestions is welcomed. Thank you</p>