c interfacing in 2.5

R

Rustom Mody

I used python extensive 3-5 years back. Coming back I find some
changes. Trying to understand whats new and would appreciate any
help/comments/pointers.

Earlier there were basically two options:
SWIG: convenient but inefficient
Native (Extending/Embedding): an efficient way of getting a headache!
(Boost being ignored because not using C++)

Now it seems there are more possibilities:

-- Sip seems to be more efficient than swig and easier than native but
not well documented
-- pyrex could be considered
-- I know someone who uses pygtk to make wrappings

But most interesting is ctype. I wonder if having ctype in the core
language changes the ease of use of the native wrapping model and
thereby makes sip/swig etc less necessary?

Your views and/or experience appreciated.
 
D

Diez B. Roggisch

Rustom said:
I used python extensive 3-5 years back. Coming back I find some
changes. Trying to understand whats new and would appreciate any
help/comments/pointers.

Earlier there were basically two options:
SWIG: convenient but inefficient
Native (Extending/Embedding): an efficient way of getting a headache!
(Boost being ignored because not using C++)

Now it seems there are more possibilities:

-- Sip seems to be more efficient than swig and easier than native but
not well documented
-- pyrex could be considered
-- I know someone who uses pygtk to make wrappings

But most interesting is ctype. I wonder if having ctype in the core
language changes the ease of use of the native wrapping model and
thereby makes sip/swig etc less necessary?

Your views and/or experience appreciated.

ctypes is for C. Where it is great to use.

If you need C++-wrapping, I recommend SIP.

While the docs for SIP aren't overwhelming, I consider them accurate and
complete. Best thing to do is to take a SIP-based project (most probably
PyQt itself) and wheneever a question appears, rummage through it.


Diez
 
S

Szabolcs Nagy

Diez said:
ctypes is for C. Where it is great to use.

if you need simple wrappers then swig and ctypes are both good since
they can generate it for you

pyrex is also good for wrapping and for writing c extension code
If you need C++-wrapping, I recommend SIP.

i recommend py++ for wrapping c++
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,126
Latest member
FastBurnketoIngredients
Top