Writing bindings and wrappers

All the time I see people writing wrappers, say, a module written in the X language, to use it in the Y-language. I wanted to know the basics of writing such wrappers. Where to begin? My question here is more specific to libgnokii , how do I start writing python bindings for it.

+7
python binding
source share
2 answers

You can start by reading this: python extension using c or C ++ And then when you decide it's too much trouble, you can check swig or maybe Boost.Python . ctypes may also be useful.

I did the manual packaging of C ++ classes, and I used swig. swig was much easier to use, but in the end I wanted to do something that wasnโ€™t easy to do (or I was too lazy to understand how). So I finished the manual packaging. This is a bit of work, but if you know a little C, it is very doable.

+7
source share

You can start by searching here for information on the Python extension using C. You will probably want to think about how to translate the libgnokii API into something Pythonic while you're on it. If you donโ€™t want to work hard, you can simply write a thin shell that translates all gnokii API calls into Python functions.

+2
source share

All Articles