Replacing call to PyObject_CallObject with PyEval_CallFunction

grbgooglefan ganeshborse at gmail.com
Wed Jan 30 02:38:46 EST 2008


On Jan 30, 1:58 pm, Gabriel Genellina <gagsl-... at yahoo.com.ar> wrote:
> On 30 ene, 01:58, grbgooglefan <ganeshbo... at gmail.com> 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->nion­um);
>
> > 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

slowness of current code - vector is to parsed one by one & switch
adds another time for checks.



More information about the Python-list mailing list