Re: Easier to wrap C or C++ libraries?

2009-02-16 Thread Hrvoje Niksic
Nick Craig-Wood n...@craig-wood.com writes: Christian Heimes li...@cheimes.de wrote: Hrvoje Niksic schrieb: Diez B. Roggisch de...@nospam.web.de writes: The answer is easy: if you use C, you can use ctypes to create a wrapper - with pure python, no compilation, no platform issues.

Re: Easier to wrap C or C++ libraries?

2009-02-15 Thread Diez B. Roggisch
Hrvoje Niksic schrieb: Diez B. Roggisch de...@nospam.web.de writes: The answer is easy: if you use C, you can use ctypes to create a wrapper - with pure python, no compilation, no platform issues. The last part is not true. ctypes doesn't work on 64-bit architectures, nor does it work when

Re: Easier to wrap C or C++ libraries?

2009-02-15 Thread Thomas Heller
Christian Heimes schrieb: Hrvoje Niksic schrieb: Diez B. Roggisch de...@nospam.web.de writes: The answer is easy: if you use C, you can use ctypes to create a wrapper - with pure python, no compilation, no platform issues. The last part is not true. ctypes doesn't work on 64-bit

Re: Easier to wrap C or C++ libraries?

2009-02-15 Thread Nick Craig-Wood
Christian Heimes li...@cheimes.de wrote: Hrvoje Niksic schrieb: Diez B. Roggisch de...@nospam.web.de writes: The answer is easy: if you use C, you can use ctypes to create a wrapper - with pure python, no compilation, no platform issues. The last part is not true. ctypes doesn't

Re: Easier to wrap C or C++ libraries?

2009-02-14 Thread Diez B. Roggisch
argo...@gmail.com schrieb: When creating a Python binding to a C or C++ library, which is easier to wrap, the C lib or the C++ one? Given a choice, if you had to choose between using one of two libs, one written in C, the other in C+ + -- both having approximately the same functionality -- which

Re: Easier to wrap C or C++ libraries?

2009-02-14 Thread argo785
On Feb 14, 12:14 pm, Diez B. Roggisch de...@nospam.web.de wrote: The answer is easy: if you use C, you can use ctypes to create a wrapper - with pure python, no compilation, no platform issues. Which IMHO makes a strong point for C - if you need OO, it's bolted on easily using Python itself,

Re: Easier to wrap C or C++ libraries?

2009-02-14 Thread Hrvoje Niksic
Diez B. Roggisch de...@nospam.web.de writes: The answer is easy: if you use C, you can use ctypes to create a wrapper - with pure python, no compilation, no platform issues. The last part is not true. ctypes doesn't work on 64-bit architectures, nor does it work when Python is built with

Re: Easier to wrap C or C++ libraries?

2009-02-14 Thread Christian Heimes
Hrvoje Niksic schrieb: Diez B. Roggisch de...@nospam.web.de writes: The answer is easy: if you use C, you can use ctypes to create a wrapper - with pure python, no compilation, no platform issues. The last part is not true. ctypes doesn't work on 64-bit architectures, nor does it work

Easier to wrap C or C++ libraries?

2009-02-13 Thread argo785
When creating a Python binding to a C or C++ library, which is easier to wrap, the C lib or the C++ one? Given a choice, if you had to choose between using one of two libs, one written in C, the other in C+ + -- both having approximately the same functionality -- which would you rather deal with

Re: Easier to wrap C or C++ libraries?

2009-02-13 Thread Daniel Fetchinson
When creating a Python binding to a C or C++ library, which is easier to wrap, the C lib or the C++ one? Given a choice, if you had to choose between using one of two libs, one written in C, the other in C+ + -- both having approximately the same functionality -- which would you rather deal

Re: Easier to wrap C or C++ libraries?

2009-02-13 Thread Chris Rebert
++ code *could* also be staightforward... Are there many pitfalls when having to map C++'s notion of OO to Python? You're asking two separate questions here. (1) For Python bindings, is it easier to wrap C, or C++ libraries? As Daniel points out, C is easier to wrap because CPython itself is written