Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Christian Gollwitzer Newsgroups: comp.lang.python Subject: Re: Python, C++ interaction Date: Thu, 04 Dec 2014 09:49:01 +0100 Organization: A noiseless patient Spider Lines: 18 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 4 Dec 2014 08:48:35 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="0e5522bc36df6ad040e4598fab9db9ed"; logging-data="19687"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RJ3vhPEy4bni31mt5ibm0d+2O+WSjxwI=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:9cgLyE2pX4W3ozAx9sosn8Bama4= Xref: csiph.com comp.lang.python:81885 Am 03.12.14 09:29, schrieb Michael Kreim: > 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. I don't know why SWIG is discouraged; in my experience, it is a very easy way to generate the wrapping code around C++ classes, and also flexible in many directions. It can be easily extended for new datatypes (there is a numpy interface module, for instance), and also generates code for other scripting languages as well. What specifically did you try, and what failed? Concerning the callbacks, I don't know about these, but hopefully you are aware that you can easily loose the C++ speed advantage by using Python lambdas, since those have to go through the Python interpreter. Christian