Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.05; 'subject:Python': 0.06; 'compiler': 0.07; '"c"': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'language.': 0.14; "api's": 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; '(you': 0.16; 'code.': 0.18; 'header:User-Agent:1': 0.23; 'source': 0.25; 'extension': 0.26; 'header:X-Complaints-To:1': 0.27; "i'm": 0.30; 'code': 0.31; 'extending': 0.31; 'writes:': 0.31; 'allows': 0.31; 'run': 0.32; 'subject:with': 0.35; 'but': 0.35; 'charset:us-ascii': 0.36; 'application': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'first': 0.61; 'received:217': 0.63; 'compiling': 0.84; 'good,': 0.91; 'step.': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: dieter Subject: Re: Passing C pionters to Python for use with cffi Date: Fri, 11 Oct 2013 08:09:38 +0200 References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e093a6.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:nYrA018ANDLRdoAz4ZREVjOVXCo= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381471792 news.xs4all.nl 15901 [2001:888:2000:d::a6]:46921 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56649 Eric Frederich writes: > I'm extending an application that supports customization using the C > language. > I am able to write standalone python applications that use the C API's > using cffi. > This is good, but only a first step. > > This application allows me to register code that will run on various events > but it has to be C code. You might want to have a look at "cython". "cython" is a compiler compiling source programs in a Python extension into "C". The corresponding "C" functions can then be called from "C" (you may need to annotate the functions used in this way to get proper "GIL" ("Global Interpreter Lock") handling).