Do python support pointers

Frederic Giacometti frederic.giacometti at arakne.com
Thu May 24 22:29:11 EDT 2001


Martin von Loewis wrote:

> "Sameer Kshatriya" <sameerk at ruksun.com> writes:
>
> > I have a problem is accessing a pointer variable.I have a dll, that
> > iam loading in Python,one of its exported function returns a pointer
> > to an interface using which iam suppose to call certain
> > functions. Now iam not able to make call to functions using the
> > pointer returned by the exported finction. How can i do this.
>
> You need to create a Python wrapper object for the pointer. Suppose
> the function returning the point is "foo", and the interface
> operations are "bar" and "foobar". Then you'd do

Actually, if you just want to pass around references (memory address,
pointer, u-name-it) to C objects, you can easily do it with Python
CObjects; it's a Python built-in type for passing around opaque pointers.
See the Python C API documentation.

Frederic Giacometti








More information about the Python-list mailing list