
SIP takes a set of specification (.sip) files describing the API and generates the required C++ code.
#C makefile example with dist generator
It is an extension module generator similar to SWIG but is specifically designed for creating Python modules SIP is Python extension module generator for C and C++ libraries. SIP is a tool for quickly writing Python modules that interface with C++ and C libraries. Therefore, the easiest way of creating a specification file is to edit the corresponding header file. The format of a specification file is almost identical to a C or C++ header file. the classes, methods, functions and variables. The specification files contains a description of the interface of the C or C++ library, i.e. Provides support functions to the automatically generated code.
#C makefile example with dist code
Processes a set of specification files(.sip) and generates C or C++ code which is then compiled to create the bindings extension module. SIP comprises a code generator and a Python module. SIP is a tool that makes it very easy to create Python bindings for C and C++ libraries. Such extension modules are often called bindings for the library. The C++ code is very simple, and it has a method called reverse() returning a reverse string of a member which was an argument for the constructor of the class.Īll of the processes are included in this tutorial: downloading, installing sip, making bindings and using C++ library from Python code.Īmong the features of Python that makes it so powerful is it's ability to take existing libraries, written in C/C++, and make them available as Python extension modules. The example I'll use is the same one given in In this tutorial, I'll make a library from C++ code, and use the class and its method from Python side.
