Sunday, December 14, 2008

swig and python with Extension module

There is a much simpler way to create interface to C/C++ code. Simply use Extension module from distutils.core (setup.py).
You simply have to type sudo python setup.py install and you can access your module in python. (import example; example.cube(3))

Thanks to PA recommendation.
My next steps are to create a python interface to flayers (my C++ neural network library) and convert arguments. PA suggest boost.python for arguments conversions.

I have also experience setup module from setuptools to create mlboost setup.py file. setuptools use indirectly easy_install that doesn't work as well as aptitude on ubuntu. Unfortunatly, matplotlib dependency doesn't work but it is included in scipy through mlab interface.

No comments:

Post a Comment