سؤال

say I have a python object "o" with a method "m()", and I want to pass it as:

PyObject *f(PyObject *self, PyObject *args)
{
  PyObject *o;
  PyArg_ParseTuple(args, "O", &o);
  //o.m();
}

Apparently the last commented line doesn't compile, and I wonder whether there is a way I can achieve this.

هل كانت مفيدة؟

المحلول

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top