Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'url:sourceforge': 0.03; 'algorithm': 0.04; 'compiler': 0.07; 'linux,': 0.07; 'mentioned,': 0.07; "subject:' ": 0.07; 'wrapper': 0.09; 'python': 0.11; 'gui': 0.12; 'project,': 0.12; "'c'": 0.16; '(also': 0.16; 'advice,': 0.16; 'afterwards': 0.16; 'doing,': 0.16; 'gonna': 0.16; 'ms- windows': 0.16; 'rs232': 0.16; 'simple.': 0.16; 'sockets': 0.16; 'subject:program': 0.16; 'wrote:on': 0.16; 'appropriate': 0.16; 'wrote:': 0.18; 'library': 0.18; 'all,': 0.19; 'bit': 0.19; 'module': 0.19; 'basically': 0.19; "python's": 0.19; 'tests': 0.22; 'to:name:python-list@python.org': 0.22; 'bytes': 0.24; 'driver': 0.24; 'environment': 0.24; 'question': 0.24; 'sort': 0.25; "i've": 0.25; 'appreciated': 0.26; 'compiled': 0.26; 'logging': 0.26; 'task': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'testing': 0.29; 'correct': 0.29; 'rest': 0.29; 'appreciated.': 0.29; 'chris': 0.29; 'unix': 0.29; 'ease': 0.30; 'forgot': 0.30; "i'm": 0.30; 'url:mailman': 0.30; '(which': 0.31; 'code': 0.31; 'python).': 0.31; 'figure': 0.32; 'run': 0.32; 'linux': 0.33; 'up.': 0.33; 'worked': 0.33; 'url:python': 0.33; 'everyone': 0.33; "i'd": 0.34; 'problem': 0.35; 'test': 0.35; 'but': 0.35; 'functions.': 0.36; 'url:listinfo': 0.36; 'doing': 0.36; 'charset:us-ascii': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'unit': 0.37; 'easily': 0.37; 'nov': 0.38; 'to:addr:python-list': 0.38; 'bill': 0.39; 'embedded': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'space': 0.40; 'url:mail': 0.40; 'how': 0.40; 'even': 0.60; 'easy': 0.60; 'gone': 0.61; 'today.': 0.61; 'entire': 0.61; 'john': 0.61; "you're": 0.61; 'first': 0.61; 'times': 0.62; 'header:Message-Id:1': 0.63; 'myself': 0.63; 'more': 0.64; 'great': 0.65; 'busy.': 0.68; '500': 0.70; 'cygwin': 0.84; 'experience!': 0.84; 'gcc?': 0.84; 'mingw': 0.84; 'room.': 0.84; '2013,': 0.91; 'controller': 0.91; 'edwards': 0.91; 'involved.': 0.91; 'offerings': 0.91; 'walking': 0.91; 'pc.': 0.93; 'suited': 0.93; 'tied': 0.93 From: John Pote Content-Type: multipart/alternative; boundary="Apple-Mail=_E13CA825-0BA6-43ED-A54E-1BF3D23F6F82" Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Talking to a 'C' program Date: Fri, 8 Nov 2013 16:08:54 +0000 References: To: "python-list@python.org" In-Reply-To: X-Mailer: Apple Mail (2.1510) 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: 157 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1383927012 news.xs4all.nl 15951 [2001:888:2000:d::a6]:53267 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:58810 --Apple-Mail=_E13CA825-0BA6-43ED-A54E-1BF3D23F6F82 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Thanks everyone for the advice, some good ideas to keep me busy. Will = try and look at over weekend/next week as tied up the rest of today. I've used pyserial several times - many thanks to Chris Liechti for = that module Hmmmmm must be loosing it, forgot about stdin/out! I've also used CUnit before and it's nice an easy and small. Problem is = I've only 500 bytes code space left on the micro-controller so by the = time CUnit gone in with the various tests I'm gonna run of room. I have = to keep the RS232 driver in as well as it's the only way to talk to the = controller. Python + pyserial enables me to run the tests with the C compiled and = run on the PC as well as compiled to run on the micro-controller. Python = is a great environment for doing this sort of thing and, as has been = mentioned, a GUI can be added easily (time permitting). Thanks again all, John =20 On 8 Nov 2013, at 15:00, Grant Edwards wrote: > On 2013-11-08, John Pote wrote: >> Hi all, >>=20 >> 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. >>=20 >> 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. >=20 > Sockets are nice and simple. Depending on what you're doing, > stdin/stdout may be even simpler. >=20 > For the RS232 part of the problem, don't forget about pyserial: >=20 > http://pyserial.sourceforge.net/pyserial.html >=20 >> Any ideas on how to do this would be gratefully appreciated. >>=20 >> 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? >=20 > I've occasionaly used mingw (which _is_ gcc), and it worked well. > Cygwin (also gcc) works well, but it's a bit more involved. >=20 > I do all my embedded development on a Linux host. I find Linux to be > far more suitable for the task -- the entire Unix system basically > evolved as a software development platform. I've yet to figure out > what MS-Windows is suited for other than lining Bill Gates' pockets. >=20 > Before Linux, I used Solaris/SunOS, and before that I used Unix V7. > Everytime I've been involved in a Microsoft-hosted embedded > development project, I just end up walking a way afterwards shaking my > head in puzzlement. >=20 > --=20 > Grant Edwards grant.b.edwards Yow! I'm having a > at tax-deductible = experience! > gmail.com I need an energy = crunch!! > --=20 > https://mail.python.org/mailman/listinfo/python-list --Apple-Mail=_E13CA825-0BA6-43ED-A54E-1BF3D23F6F82 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii invalid@invalid.invalid> = wrote:
On 2013-11-08, 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.

Sockets are nice and simple. =  Depending on what you're doing,
stdin/stdout may be even = simpler.

For the RS232 part of the problem, don't forget about = pyserial:

 http://pyserial.sou= rceforge.net/pyserial.html

Any = ideas on how to do this would be gratefully appreciated.

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've occasionaly used mingw (which _is_ = gcc), and it worked well.
Cygwin (also gcc) works well, but it's a = bit more involved.

I do all my embedded development on a Linux = host.  I find Linux to be
far more suitable for the task -- the = entire Unix system basically
evolved as a software development = platform.  I've yet to figure out
what MS-Windows is suited for = other than lining Bill Gates' pockets.

Before Linux, I used = Solaris/SunOS, and before that I used Unix V7.
Everytime I've been = involved in a Microsoft-hosted embedded
development project, I just = end up walking a way afterwards shaking my
head in = puzzlement.

--
Grant Edwards =             &n= bsp; grant.b.edwards        Yow! = I'm having a
=             &n= bsp;           &nbs= p;        at =             &n= bsp; tax-deductible experience!
=             &n= bsp;           &nbs= p;    gmail.com =            I need = an energy crunch!!
--
https://mail= .python.org/mailman/listinfo/python-list

= --Apple-Mail=_E13CA825-0BA6-43ED-A54E-1BF3D23F6F82--