[Python-Dev] Minipython

Milan Krcmar krcmar at datinel.cz
Sun Sep 24 00:14:41 CEST 2006


I would like to run Python scripts on an embedded MIPS Linux platform
having only 2 MiB of flash ROM and 16 MiB of RAM for everything.

Current (2.5) stripped and gzipped (I am going to use a compressed
filesystem) CPython binary, compiled with defaults on a i386/glibc
Linux, results in 500 KiB of "flash". How to make the Python interpreter
even smaller?

- can I completely drop out lexical analysis of sourcecode and compilation
  to bytecode? is it relevant enough to the size of interpreter?

- should I drop "useless" compiled-in modules? (what I need is a
  replacement for advanced bash scripting, being able to write more
  complex scripts and avoid forking tens of processes for things like
  searching filesystem, formating dates etc.)

I don't want to re-invent the wheel, but all my attempts at finding
Python for embedded systems ended in instructions for embedding
Python in another program :-)

Can you give me any information to start with? I would prefer stripping
current version of Python rather than returning to a years-old (but
smaller) version and remembering what of the new syntax/functionality to
avoid.

TIA, Milan


More information about the Python-Dev mailing list