On Oct 10, 12:04 pm, Gordon Allott <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > Did you try: > > > tmp= PyLong_FromLong( ( long ) info.info.x11.display ); > > PyDict_SetItemString (dict, "display", tmp); > > Py_DECREF (tmp); > > > Or also try: > > > PyCObject_AsVoidPtr( tmp ); > > -- > >http://mail.python.org/mailman/listinfo/python-list > > the problem is that I can't edit the C code - well I can and might > submit a patch to the project but I also need a solution that works from > the python side of things. >
I see. If I understand, you have a PyCObject in a dictionary. Look at the 'ctypes' module and try calling PyCObject_AsVoidPtr. Its return type should be 'c_void_p', and you can use 'result.value' to get the original pointer. -- http://mail.python.org/mailman/listinfo/python-list