Pergunta

Say I have a python list:

l=[[1,2],[3,4]]

I want to pass it to the following C extension:

PyObject *acc(PyObject *self, PyObject *args)
{
PyObject * l;
PyArg_ParseTuple(args, "O", &l);
//l.append([5,6]
}

I just wonder how to modify the above function to achieve what I want to do in the comment line.

Foi útil?

Solução

Err, that would be PyList_Append()...

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top