Am 16.10.12 18:42, schrieb Evan Driscoll:
For instance, I used it to wrap the OS's opendir/readdir
(FindFirstFile/FindNextFile) functions: I just wrote a bit of code using
Cython's extensions, and I get a module I can import and use as normal.
Well, but for an existing library in C++ possibly SWIG will be the
easiest way to go; since you already have a header file, it might be
enough to do
swig -python -c++ myheader.hpp
to get the wrappers generated. This works well in simple cases. For
complicated cases like trying to wrap large template libraries like STL
or Boost, it is also necessary to twiddle with SWIGs interface language.
In many cases, however, this can be #ifdef'ed in the header file itself,
therefore it is easy to keep the interface in sync with the class library.
Christian
--
http://mail.python.org/mailman/listinfo/python-list