FAQ
I've got a third-part application that exposes a C API. I'd like to
wrap it in Python. Is there a specific forum that covers extending and
embedding Python, or are those type of questions O.K. on this list?

Scott Huey

Search Discussions

  • Fredrik Lundh at Jun 9, 2006 at 8:18 pm

    Redefined Horizons wrote:

    I've got a third-part application that exposes a C API. I'd like to
    wrap it in Python. Is there a specific forum that covers extending and
    embedding Python, or are those type of questions O.K. on this list?
    those type of questions are perfectly okay on this list, but if you're
    using SWIG or Pyrex:

    http://www.swig.org/
    http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/

    (which are probably the most commonly used tools for this kind of task),
    you might get quicker/better responses on the tool-specific lists.

    if you prefer to "handroll" your C wrapper, start here:

    http://docs.python.org/ext/ext.html

    (to get more examples, look in the Modules directory in the Python
    distribution).

    hope this helps!

    </F>
  • Scott David Daniels at Jun 9, 2006 at 9:05 pm

    Redefined Horizons wrote:
    I've got a third-part application that exposes a C API. I'd like to
    wrap it in Python. Is there a specific forum that covers extending and
    embedding Python, or are those type of questions O.K. on this list?
    This is the place. Swig & Pyrex are a couple of standard answers.

    --Scott David Daniels
    scott.daniels at acm.org
  • Malv at Jun 10, 2006 at 7:48 pm

    Redefined Horizons wrote:
    I've got a third-part application that exposes a C API. I'd like to
    wrap it in Python. Is there a specific forum that covers extending and
    embedding Python, or are those type of questions O.K. on this list?

    Scott Huey
    Over the years, many posts (and questions) have come up on dynamically
    importing and reloading modules and the inadequacy of the now available
    import and reload() features. This should enable one to modify or add
    code at runtime without having to restart the application.
    Unfortunately, few respondents understand the implications of this
    possibility. Regrettably also some display their ignorance by swinging
    their self perceived weight around.

    James Coplien, a Bell Laboratories Scientist, published "Advanced C++
    Programming Styles and Idioms". Although now 15 years old, this book
    still has today quite some impact. Of particular interest for the
    problem at hand is Chapter 9 which presents idioms supporting
    incremental run-time update. Further Coplien illustrates in this
    chapter the major advantage gained by languages like Smalltalk and Lisp
    in this matter by having incremental run-time update as a built-in
    feature.

    Reading Coplien may further the cause of this very basic missing
    requirement in Python,
  • Fredrik Lundh at Jun 10, 2006 at 8:08 pm

    malv wrote:

    Over the years, many posts (and questions) have come up on dynamically
    importing and reloading modules and the inadequacy of the now available
    import and reload() features.
    and this is related to extending Python with code from existing C
    libraries in exactly what way ?
    Reading Coplien may further the cause of this very basic missing
    requirement in Python,
    so, what are you waiting for ? just do it, and post a patch when you're
    done.

    </F>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJun 9, '06 at 7:58p
activeJun 10, '06 at 8:08p
posts5
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase