title: How to return a value from C to python from C's PyObject type of functions?
body: <p>I was trying to pass a value by calling C file from python and then return that value from C to python again. </p>
  
  <p>My question is how to do this? Can it possible to use return <code>Py_BuildValue(a+b)</code> kind of thing?</p>
  
  <pre><code>#include &lt;Python.h&gt;
  
  static PyObject *
  hello_world(PyObject *self, PyObject *noargs)
  {
     int a=5,b=10;
  
     return Py_BuildValue(a+b); //This is Errorus.
  }
  
  
  static PyMethodDef
  module_functions[] = {
      { "hello_world", hello_world, METH_NOARGS, "hello world method" },
      { NULL }
  };
  
  
  
  PyMODINIT_FUNC
  inittesty2(void)
  {
      Py_InitModule("testy2", module_functions);
  }
  </code></pre>