Mailing List Archive

extention modules.
Hi, I am writing an extention module in C. Well I'm writing the low level (math
intensive) stuff in C and want to wrap it up in some native python classes for
a nice api. Should I write it as two seperate modules (the compiled C one and
the native python one) or is there a way to combine them in one. I am using the
SWIG program to wrap my C library.

Help apreciated.

--
John Travers

"Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us!"
extention modules. [ In reply to ]
> Should I write it as two seperate modules (the compiled C one and
> the native python one) or is there a way to combine them in one. I am
> using the SWIG program to wrap my C library.

It is often the practice to put make a Python module that imports a C
module. That's what I'm doing with Multipack
http://oliphant.netpedia.net/multipack.html
You can construct C-modules that don't need a Python wrapping, however, it
is easier to handle the user-end API in Python.

If you are doing math intensive calculations, have you looked at the
Numeric extensions?

Good luck,

Travis