[Tutor] python links

Michael Langford mlangford.cs03 at gtalumni.org
Mon Dec 17 04:15:31 CET 2007

Cross compiling python can be a bit of a bear. There build process has
python scripts that assume that you're building python for the machine
you are building on. There is a patch to help for that which Chris
Lambacher has recently updated:

I've not tried it yet, as I've not had an applicable project. If you
use it, please let me know how it goes, as I love to see python on
these systems. Please keep me in the loop on this matter if you don't
mind...I like to see my two primary skill areas overlap as much as

Before Lambacher did his updates, I have had success on one Linux
platform and failure on another with the original patch.

Keep in mind the term "Embedding" in the python world means something
entirely unrelated to embedded systems. It means adding the
interpreter as a scripting language into an application, usually that
runs on a normal, desktop OS. For instance, the computer game
Civilization IV did this, so the graphics parts are written in C, and
the "game" part is written in python. It's a cool process, however
it's not what you're looking for. This will probably plague some of
your web searching and reading. I find looking for cross compiling
helps with this, as well as identifying embedded projects, such as
gumstix. If their stuff compiles on your target board, I've had some
success in the past with some of their stuff, (their buildroot I
think), although the python compile didn't work for my platform.

Disregard Jepp and Embedding Python with Boost.Python Part 1. They are
not the type of embedding you're looking for.

PyMite looks promising for the type of processor I think you're
interested in targeting (http://pymite.python-hosting.com/wiki/PyMite
is their new site). This could most likely be brought up for you by a
consultant if you don't meet sucess and then the actual application
code could then be written by you. With a little flexability on
processor, I am pretty sure you could get it running from their
description as long as you don't need floating point.

DePython doesn't appear to still be under active development (Broken
links, no visible source repository, etc). I usually run kicking and
screaming away from abandoned projects, and this looks like an
abandoned academic project to boot.

If you are going to go with a processor on which you can embed Linux,
there is a python in the buildroot tree, however buildroot can be
quite the crap shoot, depending on processor and mix of applications
(It didn't work on the last board I was using buildroot on).


Michael Langford
Phone: 404-386-0495
Consulting: http://www.RowdyLabs.com

On Dec 16, 2007 9:32 PM, Mark Alexiuk <malexiuk at gmail.com> wrote:
> Hi All,
> I have no experience using Python in an embedded application (industrial
> microcontrollers) but I'm sure it can be done and feel that Python offers
> many advantages for new OOP developers over C++.
> I would appreciate any suggestions on embedded processors compatible with
> Python or some variant and what libraries people find useful, such as
> UnitTest and Logging.
> What follows are some links and excerpts I found looking for information on
> this topic.
> Cheers,
> Mark
> ===========================================
> Open Embedded
>  OpenEmbedded is a tool which allows developers to create a fully usable
> Linux base for various embedded systems.
> http://www.openembedded.org/
> ===========================================
> Embedded Python
> Some modern embedded devices have enough memory and a fast enough CPU to run
> a typical Linux-based environment, for example, and running CPython on such
> devices is mostly a matter of compilation (or cross-compilation) and tuning.
> Devices which could be considered as "embedded" by modern standards and
> which can run tuned versions of CPython include the following:
>  Gumstix
>  FIC Neo1973 ( Python on OpenMoko)
> See also PythonForArmLinux and OpenEmbedded.
>  http://wiki.python.org/moin/EmbeddedPython?highlight=%28embedded%29
> ===========================================
> Python compilers are available for some popular microcontrollers. Pyastra
> [1] compiles for all Microchip PIC12, PIC14 and PIC16 microcontrollers.
> PyMite [2] compiles for "any device in the AVR family that has at least 64
> KiB program memory and 4 KiB RAM". PyMite also targets (some) ARM
> microcontrollers. Notice that these embedded Python compilers typically can
> only compile a subset of the Python language for these devices.
> http://en.wikibooks.org/wiki/Embedded_Systems/Embedded_Systems_Introduction
> ===========================================
> PyMite: A Flyweight Python Interpreter for 8-bit
> Architectureshttp://python.fyxm.net/pycon/papers/pymite/
> ===========================================
>  George Belotsky is a software architect who has done extensive work on high
> performance Internet servers as well as hard real time and embedded systems.
> His technology interests include C++, Python and Linux.
> SOURCE: http://pythonology.org/success&story=carmanah
> ===========================================
> Embedding Python with Boost.Python Part 1
>  Python has been called a language optimized for development speed. This
> puts it in contrast with compiled languages like C and C++, which can be
> called languages optimized for execution speed. This contrast between Python
> and C/C++ often fuels a development methodology in Python circles: code the
> application in Python, profile the application, and rewrite the performance
> critical parts in C or C++. This makes the topic of developing hybrid
> systems by extending Python very well covered in various Python
> documentation.SOURCE:
> http://members.gamedev.net/sicrane/articles/EmbeddingPythonPart1.html
> ===========================================
> Java Embedded Python Jepp embeds CPython in Java. It is safe to use in a
> heavily threaded environment, it is quite fast and its stability is a main
> feature and goal.
> Some benefits of CPython over Java-based languages:
> Using the native Python interpreter may mean a massive speed improvement
> over Java-based languages.
> Python is mature so authors needn't fear the interpreter will suddenly
> change widely-used features.
> Access to the high quality Python modules, both native and Python-based.
> Compilers and assorted Python tools are as mature as the language.
> Python is an ideal language for your business logic. It is easy to learn,
> eminently readable and generally immune to programming gotchas.
> SOURCE: http://jepp.sourceforge.net/
> ===========================================
> DePython
> In the DePython  (Deeply Embeddable Python) project we have created a
> stripped-down version of Python  that provides a platform for implementing
> embedded systems in the Python language.  Specifically the DePython system
> provides the following advantages of Javatm:
> absolutely free, even for commercial use (including resale),
> small footprint (<200K)
> easy maintenance of software: objects and methods can be replaced
> ``on-the-fly''
> reference counting garbage-collection giving more deterministic performance
> Currently DePython runs on a Hitachi SH1 evaluation board with some extra
> hardware.  The SH1 is a 32 bits RISC micro-controller running at 16Mhz.  T
> he evaluation is equipped with 256Kb of RAM, 64Kb of ROM, two RS-232 ports,
> and a number of I/O ports.
> SOURCE: http://www.tucs.fi/magazin/output.php?ID=2000.N2.LilDeEmPy
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

More information about the Tutor mailing list