Approach to Python extension with C++
Bjorn Pettersen
BPettersen at NAREX.com
Fri Nov 8 06:51:51 EST 2002
> From: Nicholas Yue
>
> I have a need to write Python interfaces to some commercial
> libraries that are available on Windows and Linux.
>
> I have read about the steps to do that in Mark Hammond's
> Python Programming book and have also read the extending
> Python in the Python Essential Reference (first version).
>
> I am attempting to write the interface in a cross platform
> manner, is the use of Setup.in and compile.py the way to go.
>
> I am using ActiveState Python 2.2.2 on Windows and probably
> 2.0/2.1/2.2 on Linux. I am writing the interface code in C++.
>
> What is your advice?
Save yourself a _lot_ of time and effort by using one of the existing
wrapper generators like SIP, SWIG, or Boost.Python. Having used all
three for major projects I prefer Boost.Python (for most complete
support of C++ and Python features, and excellent support) If your
interface is simple enough either one will do.
-- bjorn
More information about the Python-list
mailing list