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


Groups > comp.lang.python > #58797

Re: Talking to a 'C' program

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <oscar.j.benjamin@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.016
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'algorithm': 0.04; 'compiler': 0.07; "subject:' ": 0.07; 'wrapper': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'assume': 0.14; 'windows': 0.15; "'c'": 0.16; 'cc:name:python list': 0.16; 'rs232': 0.16; 'subject:program': 0.16; 'appropriate': 0.16; 'wrote:': 0.18; 'library': 0.18; 'all,': 0.19; 'module': 0.19; "python's": 0.19; 'cc:addr:python.org': 0.22; 'fine': 0.24; 'environment': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'appreciated': 0.26; 'logging': 0.26; 'task': 0.26; 'supported': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'testing': 0.29; 'correct': 0.29; 'appreciated.': 0.29; 'ease': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'python).': 0.31; 'up.': 0.33; "i'd": 0.34; 'test': 0.35; 'received:google.com': 0.35; 'functions.': 0.36; 'url:org': 0.36; 'unit': 0.37; 'embedded': 0.39; 'sure': 0.39; 'how': 0.40; 'easy': 0.60; 'john': 0.61; 'first': 0.61; 'myself': 0.63; 'within': 0.65; 'gcc?': 0.84; 'mingw': 0.84; 'oscar': 0.84; 'controller': 0.91; 'offerings': 0.91; 'officially': 0.91; 'pc.': 0.93; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=OtqXVPwvEw7vSM5JeJbh8V0ZcflGYq+JwHvW9jHzjV0=; b=ExYaG3GMQbeEVWsZVSPerbY7XTj2LIoRekL8Uh/YDsWwR/THSUDGqwGaGfxOSdqfhY aJv4VNShCS9ylWCqYU+cxzvcIIq7jtnB2HnMpKG5q9xg05nxKha6sr5JF0owY2ofxVR+ mRLldairuZPwQLTOnO9z4DhHv8NXaCC30NQJKa6GKRSRBfDu6JtBZju1gE7MIlrbvgIy R9Nl1kUhrn+7RgAIjCFDiWvamYyKrHVZOHdgKAtTyFyoc3vVsFlfA5AcnuksjHYahz50 ACUVRCWpCEegK/GnA0alWU9i10lhoIQ4gVLGLdHENyqHUTj88c9/bUFosFSzMvQH/tkM gFtg==
X-Received by 10.52.26.69 with SMTP id j5mr10345090vdg.21.1383921472626; Fri, 08 Nov 2013 06:37:52 -0800 (PST)
MIME-Version 1.0
In-Reply-To <89D0AF8F-FE2A-4051-84E7-7373A7340C35@o2.co.uk>
References <89D0AF8F-FE2A-4051-84E7-7373A7340C35@o2.co.uk>
From Oscar Benjamin <oscar.j.benjamin@gmail.com>
Date Fri, 8 Nov 2013 14:37:32 +0000
Subject Re: Talking to a 'C' program
To John Pote <johnhpote@o2.co.uk>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
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.2221.1383921481.18130.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1383921481 news.xs4all.nl 15918 [2001:888:2000:d::a6]:38295
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:58797

Show key headers only | View raw


On 8 November 2013 14:23, John Pote <johnhpote@o2.co.uk> wrote:
> Hi all,
>
> I have the task of testing some embedded 'C' code for a small micro-controller. Thought it would be a good idea to test it on the PC first to make sure the algorithm is correct then perhaps test it on the controller via RS232 and an appropriate wrapper round the 'C' functions.
>
> On the PC I can use Python's unit test library module and logging to create a nice and easy to use environment (I like Python). So my question is how to communicate from Python to the C module on the PC. What I'd like is simplicity and ease of setting up. All I can think of myself is to use sockets.
>
> Any ideas on how to do this would be gratefully appreciated.

Have a look at Cython:
http://cython.org/

This enables you to call C code from Python code within the same process.

> Also as I don't have any microsoft offerings of a C compiler any suggestions as to a suitable C compiler for a PC appreciated as well. llvm? mingw? gcc?

I assume that by "PC" you mean Windows in which case mingw is a fine
choice and is officially supported by Cython.


Oscar

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Talking to a 'C' program Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-11-08 14:37 +0000
  Re: Talking to a 'C' program Grant Edwards <invalid@invalid.invalid> - 2013-11-08 15:04 +0000

csiph-web