dear kopsis, many thanks for your work!is there a certain order in which python-exe looks for the img?i copied the img from my SD to home/zaurus/Documents on my C3000 and ran the python-exe from my SD. the installation worked perfectly, though it mounted the img which was still on SD. actually this is not a problem at the moment, as i usually always have this particular SD in my system, but i'm curious of how to change the default location for the img.

The file /etc/rc.d/init.d/mntpython is a "shell script" that controls locating and mounting the image. You can view it in any text editor and you'll see that starting around line 12 is a big block of if/elif statements that are used to locate the image file. I kept the script brutally simple so you don't have to be a shell scripting guru to understand what it's doing By simply changing the order of those if/elif statements, you can control the order in which the script searches for the images.

Just installed your Python cramfs image on the main memory of my c860 and there is a small error in the mntpython script. when it searches for the image it looks for /home/zaurus/Documents/${PYTHON}.img but then sets IMAGEDIR="/home/zaurus/" so the mount then fails.

I just changed IMAGEDIR="/home/zaurus/Documents/" and everything works fine. Just need to learn more than print "Hello World" now

My Python image is designed for ROMs build with gcc 2.95 using the standard Sharp libraries. I'm pretty sure it will not work with OpenZaurus nor pdaXrom since both of those have kernels and libraries built with gcc 3.x using the -msoft-float option. For OZ you may want to check out the Python for ARM-Linux project (though the site appears to be down at the moment).

I don't have a complete list of included modules but my Python image is basically just a complete build of the standard Python 2.4 distribution plus PyQt, PySqlite, and PyMySQL.

Ok I installed PyQt per instructions and when I run type python it gives me the following errors:

This sounds like a case of the Python image not getting mounted. Note that the Python executable is installed to internal storage so it's always available ... but it won't actually work unless the filesystem image gets mounted correctly by the /etc/rc.d/init.d/mntpython script.

You can verify this diagnosis by doing a "mount" command (without any parameters) from a root login in the konsole. You should see a line similar to the following:

CODE

/dev/loop1 on /home/QtPalmtop/lib/python2.4 type cramfs (rw)

The loop device may have a different number and the fs type may be "ext2" instead of "cramfs".

If you don't have a line similar to the above, try the following command (from a root login):

CODE

/etc/rc.d/init.d/mntpython start

Post any error messages and we'll work through what might be tripping things up.

However, my own PyQt program encountered low memory problem. Is there any way to solve my memory problem?

The one down side of using Python is that it's a bit memory hungry. The three solutions are to either reduce memory use by other apps, reduce memory use by your Python app, or use a swapfile.

Reducing memory use by other apps may be as simple as turning off "fast load" for the standard Qtopia apps. If you're not familiar with "fast load" settings, a quick forum search will turn up all kinds of info.

You may also find that your Python app is architected such that it's wasting memory. Unfortunately, how to find and fix problems like that is way beyond what can be taught in a forum post. Google can find you examples of Python optimization techniques that may help cut your app's memory requirements. For what it's worth, I've been able to run some pretty healthy Python apps on a lowly SL-5500 by carefully designing the apps to minimize memory use. Using a sqlite database to manage the app's persistant data instead of keeping everything in Python data structures in memory can be a big win.

If you've trimmed the memory footprint for running apps and your Python code as much as practical and you still have problems, you'll need to set up a swapfile. Again, a forum search is the best way to find out how to do that. Keep in mind that swapfiles (due to fairly heavy write activity) can be fairly hard on some SD and CF cards. Choose the location wisely (eg. use an old CF card for you swapfile instead of a brand new expensive 1GB SD card) and disable the swapfile any time you don't need it.

QUOTE(freizugheit @ Feb 6 2005, 09:08 PM)

By the way, which version of PyQt is bundled and will you be able to disclose the details of subdirectories in the ex2 file.

The version of PyQt included is PyQt-x11-gpl-3.13 source downloaded from Riverbank's site and built against Python 2.4 and SIP 4.1.1. I'm not planning on posting a dump of the filesystem, but you can always browse the filesystem yourself. The ext2 (and cramfs) file mounts at /opt/QtPalmtop/lib/python2.4 ... everything under there is in the fs image.