Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81876
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <drsalists@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'static': 0.04; 'subject:Python': 0.06; '(python': 0.07; 'pypy': 0.07; 'decorator': 0.09; 'python:': 0.09; 'suggestions.': 0.09; 'wrapper': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; "(it's": 0.16; 'c++)': 0.16; 'c++.': 0.16; 'cc:name:python list': 0.16; 'ctypes.': 0.16; 'experiments': 0.16; 'lambda': 0.16; 'try?': 0.16; 'ignore': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'wed,': 0.18; 'bit': 0.19; 'later': 0.20; 'seems': 0.21; 'python?': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; "i've": 0.25; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'michael': 0.29; 'am,': 0.29; 'dec': 0.30; 'message- id:@mail.gmail.com': 0.30; 'work.': 0.31; 'code': 0.31; 'ctypes': 0.31; 'extending': 0.31; 'maintaining': 0.32; 'another': 0.32; 'classes': 0.35; 'possible.': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'c++': 0.36; 'opposed': 0.36; "i'll": 0.36; 'hi,': 0.36; 'url:org': 0.36; 'should': 0.36; 'little': 0.38; 'heard': 0.39; 'read': 0.60; "you've": 0.63; 'skip:n 10': 0.64; 'our': 0.64; 'more': 0.64; 'hints': 0.68; 'c++:': 0.84; 'try,': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5lCDYazHf0HEox4SVMGv+VYJBy6y+ySbObC5aC0kGF4=; b=IvNtsZVwvFk2aVqeT9Le9uOIPsTfo73CTVAz8+TjrlG1GQK2xtRcRi8AlTpuy8Lszn 8L9rHZslVEx3Du6JY3dwO7L8CZQfGAk0oxs5OTwPYNJ7Mgc7DhYVCTLq0G+qlAzL79gQ icGPlB6QiTTRBhYjNDOSHCUBtK4GFzTgT718hyQs+W+yH3KsnsZJ7vw5cbbmXi0DH6yi Fvxb3Ptg/cqUjZ3uxNQJuDnL9LSGNb6TsB078X126X+jIFdCy1Bc5GJ53zYG/OrwH+EY rZfpww7aZroioy9V3uIXi0WgL6Xwh4JVRbGmQaoNsivVcKhzI83P3YeOUzMG/nPLEwB2 RjPw== |
| MIME-Version | 1.0 |
| X-Received | by 10.112.150.71 with SMTP id ug7mr6704727lbb.73.1417655835867; Wed, 03 Dec 2014 17:17:15 -0800 (PST) |
| In-Reply-To | <547EC9E2.8070502@perfect-kreim.de> |
| References | <547EC9E2.8070502@perfect-kreim.de> |
| Date | Wed, 3 Dec 2014 17:17:15 -0800 |
| Subject | Re: Python, C++ interaction |
| From | Dan Stromberg <drsalists@gmail.com> |
| To | Michael Kreim <michael@perfect-kreim.de> |
| Content-Type | text/plain; charset=UTF-8 |
| Cc | Python List <python-list@python.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.16542.1417655843.18130.python-list@python.org> (permalink) |
| Lines | 34 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1417655843 news.xs4all.nl 2932 [2001:888:2000:d::a6]:36337 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:81876 |
Show key headers only | View raw
On Wed, Dec 3, 2014 at 12:29 AM, Michael Kreim <michael@perfect-kreim.de> wrote: > Hi, > I did some googleing on extending Python by C++ code but I did not find > something that satisfies me. I gave SWIG a try, but several webpages > disadvised me of using it. Also my small experiments did not work. Now, I > read about ctypes. But as far as I understood it, I have to write a C > wrapper for my C++ code and then a Python wrapper for my C code. That seems > a little complicated. > What are you using to wrap C++ classes for Python? > Can you recommend swig? Should I give it another try? > Did I misunderstood ctypes? > > Also later on in our code development we would like to pass python lambda > functions to C++. So far I understood that this seems not to be possible. Do > you have any ideas or hints on this topics? You've already received some good suggestions. I'll add that ctypes is a bit slow in CPython. Also, you might want to try one or more of the following before resorting to a less-productive language like C++: 1) writing in Cython+CPython (as opposed to wrapping C++ with Cython) 2) using numba+CPython (It's a pretty fast decorator - I've heard it's faster than Cython) 3) shedskin (translates implicitly static Python to C++) 4) pypy (Python with a JIT - ignore RPython) Here's a link I've been maintaining about ways of speeding up Python: http://stromberg.dnsalias.org/~strombrg/speeding-python/ HTH
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Python, C++ interaction Dan Stromberg <drsalists@gmail.com> - 2014-12-03 17:17 -0800
csiph-web