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: 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 Date: Fri, 8 Nov 2013 14:37:32 +0000 Subject: Re: Talking to a 'C' program To: John Pote Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Python List 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: 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 On 8 November 2013 14:23, John Pote wrote: > Hi all, > > I have the task of testing some embedded 'C' code for a small micro-contr= oller. Thought it would be a good idea to test it on the PC first to make s= ure the algorithm is correct then perhaps test it on the controller via RS2= 32 and an appropriate wrapper round the 'C' functions. > > On the PC I can use Python's unit test library module and logging to crea= te a nice and easy to use environment (I like Python). So my question is ho= w to communicate from Python to the C module on the PC. What I'd like is si= mplicity and ease of setting up. All I can think of myself is to use socket= s. > > 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 suggesti= ons 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