How do I pass structures using a C extension?

Thomas Heller theller at python.net
Mon Mar 14 22:17:35 CET 2005


"timothy.williams at nvl.army.mil" <timothy.williams at nvl.army.mil> writes:

> Thanks for all the replies so far.  I'm starting to look at SWIG, but
> the libraries I want access to are all static. I created a small
> interface file and a setup.py file, but when I build it, I get
> undefined symbols.  It sounds like the pack/unpack struct method is a
> little to messy for my tastes. I was looking at the example for
> defining a new type, but I wasn't sure how to pass the structure. I
> need to look more into the PyArg_ParseTupleAndKeywords and creating a
> list to pass into that.
>
> I haven't looked at the ctypes module yet, but it looks like it not one
> of the modules Python comes with, so I'm a little reluctant to use it.

ctypes does only support shared libraries, not static libraries.

Thomas



More information about the Python-list mailing list