In the last post of this series, we saw how to write a simple binding and we finished to build and install it manually. This is of course not a good way to manage the building/installation procedure.
In Python we can use a library called distutils that let us to automatize the building and installing process. I'll use the foo source code to create the package, so it will be easier to understand.
Using distutilsAll we have to do is to write a setup.py file similar to this one:
from distutils.core import setup, Extension
foomodule = Extension('foo', sources = ['foo.c'])
setup (name = 'Foo',
version = '1.0',
description = 'This is a package for Foo',
ext_modules = [foomodule])
As...
Leggi il seguito »


