[EMAIL PROTECTED] wrote:
> I am trying to call the method of python object. But I dont know
> how to transfer the pointer of the python object into c++ .
>
> the C++ method to receive python object pointer :
>
> static PyObject*
> ReceivePythonPointer(PyObject* self, PyObject* args)
> {
> PyObject* temp=NULL ;
>
> //translate into C++ pointer, but Failed, the temp is null
> if ( PyArg_ParseTuple(args, "0", &tmp) )
> {
> //tmp
> }
> }
use the letter O (for "object"), not the digit 0.
adding some error checking would also be a good idea. if PyArg_ParseTuple
returns false, Python's exception state is set. you can use the PyErr_Print
function to print the exception traceback (this is very useful during debugging,
at least).
</F>
--
http://mail.python.org/mailman/listinfo/python-list