Farshid Lashkari wrote: > Simon Forman wrote: > > I have not done a great deal of extension work with python, however, I > > do not believe you can simply cast an int (or pointer to int, which is > > what you say dat is declared as, unless my C is /really/ rusty) to > > PyObject*. > > > > I think you need to do something like Py_BuildValue("i", 123), but see > > http://docs.python.org/ext/buildValue.html for more info. > > Simon is correct. You need to create a python object from your unsigned > int. Try the following instead: > > PyTuple_SET_ITEM(toRet, i, PyInt_FromLong(dat[i]) ); > > -Farshid
That did the trick. thanks guys both for your help! -- http://mail.python.org/mailman/listinfo/python-list