Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: dieter Newsgroups: comp.lang.python Subject: Re: How to use internal python c funtions, from python code Date: Fri, 11 Dec 2015 09:47:20 +0100 Lines: 15 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.uni-berlin.de P6EQniogz36tRngXE5GeoQDbqCMpfqC1Fi9+q+R8jC8w== Cancel-Lock: sha1:UY8ohHJ6mPx1D9r1KpWl5Z2pcCM= Return-Path: 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; 'source,': 0.04; 'compiler': 0.05; '"c"': 0.07; 'subject:code': 0.07; 'subject:How': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'itself.': 0.11; 'extensions': 0.13; 'subject:python': 0.14; 'heapq': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'language': 0.19; 'extension': 0.20; 'defined': 0.23; 'feature': 0.24; 'module': 0.25; 'header :User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'cool': 0.27; 'module.': 0.27; 'interface': 0.29; 'source': 0.33; 'similar': 0.33; 'subject:use': 0.35; 'quite': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'subject:from': 0.39; 'easily': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'received:de': 0.40; 'received:217': 0.66; 'special': 0.73; 'compiles': 0.84 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: pd9e08198.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:100255 srinivas devaki writes: > but still I think it would be cool to be able to access internal c > functions without any fuss. I can use such feature with heapq too(sift > operations), Have a look at "Cython". It is a compiler which compiles a language similar to Python with special extensions for an efficient interface to "C" and "C++" into "C"/"C++" source which then can be built into a Python extension module and used from Python like any other Python module. In a "Cython" source, you can quite easily use C functions, among others C functions defined by Python itself.