converting C library to python

Michal Tondyra kestrel at ernie.icslab.agh.edu.pl
Mon Nov 12 05:46:25 EST 2001


On Mon, 12 Nov 2001, Michal Tondyra wrote:

> So what I have is an array of int's e.g. int my_array[100]
> and what I want to have is PyObject structure representing tuple of
> integers from my_array.

You have to build a tuple first with PyTuple_New(int size), than for every
int in my_array convert it to PyObject with PyInt_FromLong, and  add to
tuple using PyTuple_SET_ITEM.

:)
not schizophrenic - just found answer a minute ago

Michal Tondyra





More information about the Python-list mailing list