Btrieve/C-extension question

Paul Simmonds psimmo60 at hotmail.com
Thu Jun 19 10:53:16 EDT 2003


"vincent wehren" <v.wehren at home.nl> wrote in message news:<bcrua6$120$1 at news4.tilbu1.nb.home.nl>...
<Problem description snipped>
> Is it sensible to pass such a block of memory to Python and back?
> If so, what is the best way to go about this, I.O.W, how do I pass such a
> block of memory
> to Python and back (unchanged).

I think you need a PyCObject.
http://www.python.org/doc/current/api/cObjects.html

<quote from page above>
       This subtype of PyObject represents an opaque value, useful for
C extension modules who need to pass an opaque value (as a void*
pointer) through Python code to other C code.
<end quote>

It seems like this is meant for function pointers and the like, but it
works well for pieces of memory that need to be passed through Python
but not processed.

HTH,
Paul Simmonds

> 
> Any pointers would be much appreciated.
> 
> Regards,
> Vincent Wehren




More information about the Python-list mailing list