Replacing call to PyObject_CallObject with PyEval_CallFunction

Gabriel Genellina gagsl-py2 at
Wed Jan 30 06:58:35 CET 2008

On 30 ene, 01:58, grbgooglefan <ganeshbo... at> wrote:

> How do I pass the elements populated in struct variables of this
> vector dynamically to PyEval_CallFunction, in the fashion somewhat
> like below?
> PyEval_CallFunction(obj, "iii", vector[0].ioparam->nionum,vector[1].ioparam->nionum,vector[2].ioparam->nionum);
> PyEval_CallFunction(obj, "di", vector[0].ioparam->fionum,vector[1].ioparam->nionum);
> PyEval_CallFunction(obj, "diiisis", vector[0].ioparam->fionum,vector[1].ioparam->nionum,vector[2].ioparam-
> >nionum,vector[3].ioparam->nionum,vector[4].ioparam-
> >ioString,vector[5].ioparam->nionum,vector[6].ioparam->ioString);

I didn't know of PyEval_CallFunction until now, but aparently the
lines above are OK. Can't you use it that way? What's your problem?

Gabriel Genellina

More information about the Python-list mailing list