The downside of using Python on the Zaurus is that Python 2.3 is big! We're talking 30+ MiB for a relatively complete Python installation. It is possible to chop that up into different packages and install only the minimum necessary (as the excellent [[][Python on Zaurus]] project has done). However, one of Python's greatest strengths is it's rich set of run-time libraries, and most Python developers are not hesitant to use a broad range of Python features. It's almost inevitable that to support a significant interactive Python application, you'll end up with most of the Python packages installed.
To make matters worse, on a Sharp or Sharp-compatible ROM, you need to install Python into internal memory for everything to work properly (or you need to spend a lot of time manually creating symbolic links to a Python tree on a memory card). Sacrificing 30+ MiB of internal memory is tough for SL-C7X0/SL-C860/SL-6000 owners and it's virtually impossible for other less memory endowed Zaurus models.
What I've come up with is a 50 MiB "image" of a relatively complete Zaurus Python installation that you can actually use directly from a memory card (SD or CF)! Through the magic of Linux loop devices, you can trick the Zaurus into thinking the whole thing is installed to internal memory. What's even better is that since this "image" contains a complete Linux ext2 filesystem, you can use it on SD or CF cards that are formatted FAT16 or FAT32. The whole Python tree will appear as just a (large) single file on your memory card.
You'll need to download two packages from the downloads page - The Python Zaurus Image and the Python Zaurus Executable. Once you have both packages, follow these steps:
python23.img.gz
file (it's best to do this on your PC) and copy the resulting python23.img
file to the root directory of a CF or SD card. Note that the file will take up about 50 MiB of space on your memory card so you'll need at least a 64 MB card for this. Make sure you put python23.img in the card's root directory!
python_exe.ipk
file to any location on your Zaurus that will allow the Add/Remove Software utility to find it (CF or SD card or /home/zaurus/Documents).
python_exe
to internal memory. You must install the python_exe package to internal memory -- it will not work from SD or CF!
su
), and issue the command /etc/rc.d/init.d/mntpython start
python
from a shell prompt and you should get a Python interpreter prompt.
print "hello, world!"
and you should see the text "hello, world!" printed.
CTRL-D
to exit the Python interpreter.
Coming soon.
-- DavidKessler - 08 Nov 2004
to top
Project hosting provided by: | Donations welcome:![]() |