Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python.announce > #1987

PyEmbedC 1.0 - Embed C in Python code

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Fen Trias <sub@trias.org>
Newsgroups comp.lang.python.announce
Subject PyEmbedC 1.0 - Embed C in Python code
Date Sat, 16 Jan 2016 18:53:14 -0500
Lines 31
Sender fernando@trias.org
Approved python-announce-list@python.org
Message-ID <mailman.63.1453039875.15297.python-announce-list@python.org> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de SuUUsZQBhcScto/p1Uo01ws+R9lBZEBEuoi0FeR2+ZxA==
Return-Path <fernando@trias.org>
X-Original-To python-announce-list@python.org
Delivered-To python-announce-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'url:sourceforge': 0.03; 'modify': 0.04; 'subject:Python': 0.05; 'dynamically': 0.07; 'i++)': 0.07; 'subject:code': 0.07; '(int': 0.09; 'c/c++': 0.09; 'coders': 0.09; 'portions': 0.09; 'strings*': 0.09; 'example:': 0.10; 'python': 0.10; 'variables': 0.15; 'readability.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'simplifies': 0.16; 'subject:1.0': 0.16; 'arrays': 0.22; 'ctypes': 0.22; 'embedding': 0.22; 'gcc': 0.22; 'variables.': 0.22; 'code.': 0.23; 'replacing': 0.23; 'import': 0.24; 'module': 0.25; 'message- id:@mail.gmail.com': 0.27; 'skip:( 20': 0.28; 'embed': 0.29; 'improves': 0.29; 'code': 0.30; 'compiled': 0.32; 'source': 0.33; 'file': 0.34; 'received:google.com': 0.35; 'done': 0.35; 'received:209.85': 0.36; 'development.': 0.36; 'skip:& 10': 0.37; 'received:209': 0.38; 'easily': 0.39; 'to:addr:python.org': 0.40; 'maximum': 0.61; 'further': 0.62; 'within': 0.64
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=trias-org.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=jarX5MMupPzp4KmU/dlfcqawE6yfUe4mGCM4DRGLD7w=; b=dvKUh9gpGm6H9RDsPe3fezRSGZczivEULpKbTYbmXI7q1RZRoFKJDT274ELsX7gWHx fMkm3cfUPPf19tuPVdjYtas8l3UmhgH1wFhLNlwK7sMQDtZewVqi+UnFMrK/NTJAnOaY Cn4ybfCDLyaBG48J+O5uUqk5p2RFD6L0Y8gLiRfhQWm6FWCRKKyeIWnAk/anbHqGJk7I L/Ov0d1Kr99SvN/BGBR4a4btzpT+u5Zh3t6cNqgRhiUJqOZ0msaIyHn657sw+QZRepyJ boeScXg1lcpqmskN1uTnss6eHEwA1iEWFCfwVus9oqKtHpu7PybilceZ1ANi+A4ZIgJN 1q8w==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to:content-type; bh=jarX5MMupPzp4KmU/dlfcqawE6yfUe4mGCM4DRGLD7w=; b=ERDQAJzWxchqC2EeWcmrOEfvUMgZt/xIxdnl+8NCgo3O/XBqInGi3qBBYEQhs4tjsH Z/R5AKtxIxp+pK8gLSEyAtO3r3Fr9gHtNn2K99iCADU9hLvct39WcpwkAVaKgP6Xu1yy v/6xck1+YrFEIRIwrNj4imCqGsI/aaZlpEifrVKNBkmAhnDJpgaTBFQzXl5RJYr7RD3B nlIYNE22BmOdj20s6eFBYPH2smlxcr+XBftwsXNtNnj3+yl/fhz7nkyHA5kYnnnhNTo8 ORAd8hhVXpr6HXxn7j8Mc799SiuGFcxKOvC4f7o8Qj5OgC0+ucSlSDMT2VlDcHEsw0NJ I54Q==
X-Gm-Message-State ALoCoQmSAguiop7DZQBK53EQ8iYeV+MUWC7hma9ZNKWEVrpv8rK6Vfim1eOYgTWziCjXAjjs0kVOWFz8cYGhiS6CuWoBCnpbxA==
X-Received by 10.129.34.133 with SMTP id i127mr12627513ywi.153.1452988414475; Sat, 16 Jan 2016 15:53:34 -0800 (PST)
X-Google-Sender-Auth IZtKoWidDjeuNDosVfqs8suq3nM
X-Mailman-Approved-At Sun, 17 Jan 2016 09:11:14 -0500
X-Content-Filtered-By Mailman/MimeDel 2.1.20+
X-BeenThere python-announce-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id Announcement-only list for the Python programming language <python-announce-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-announce-list/>
List-Post <mailto:python-announce-list@python.org>
List-Help <mailto:python-announce-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python.announce:1987

Show key headers only | View raw


Python module for embedding C/C++ code within Python code. It is
designed to allow coders to easily speed up slow code by replacing small
portions of Python with compiled C/C++ that can transparently read
and modify Python variables. Keeping all the code in the same source
file simplifies development and improves code readability. All the
compiling and linking is done dynamically by the module to further
simplify development.

* Embed C/C++ within Python source code
* Automatically compile and dynamically link using GCC
* Access and modify Python variables as C variables
* Support arrays and strings
* Use ctypes for maximum portability

Simple Example:

from embedc import C
a=[1,4,9]
alen=len(a)
C("""
  for (int i=0; i<alen; i++) {
    a[i] = a[i]*a[i];
  }
""")
print a

Output: [1,16,81]

<P><A HREF="http://pyembedc.sourceforge.net/">PyEmbedC 1.0</A> -
Module to embed C/C++ code within Python code and read/modify
variables natively. (16-Jan-2016)<P>

Back to comp.lang.python.announce | Previous | Next | Find similar | Unroll thread


Thread

PyEmbedC 1.0 - Embed C in Python code Fen Trias <sub@trias.org> - 2016-01-16 18:53 -0500

csiph-web