Python On The Linux based iPAQ

edwardam at home.com edwardam at home.com
Wed Oct 25 00:29:55 EDT 2000


I know that if I havea program called foo.py it gets compiled into
foo.pyc and optionally foo.pyo if I pass python the right stuff. As some
of you know I've been working on packages for python on the linux based
ipaq and have already put out packages for version 1.5.2 of python.
Since the ipaq is a portable device and has some serious storage
contrains (compared to normal workstations/servers anyway), I've
included the .pyc file for all libraries on the device. No .py and no
.pyo files. Since the .pyo files are somewhat optimized (and smaller)
I;d like to start including these files instead of the .pyc files.

I noticed that if I tell python "python foo.py", that uses a library
"bar" and I have a bar.py or a bar.pyc file in my site-packages
directory everything just works. I can have either or both pyc or py and
it works. But if I only have a .pyo file (no .py or .pyc) the libraries
can't be found. I suspect if I run python with the -O flag the libraries
will work then. I also found out that I can rename the .pyo file to .pyc
files and python works as well, but is this safe?

The whole reason for the iexercise is to reduce the size of the python
libraries are much as possible.


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list