AW: Python embedding question.

David Lyon david.lyon at preisshare.net
Tue Jul 15 09:38:42 EDT 2008


Troeger, Thomas (ext) wrote:
> Thanks for your answer. The plattform is x86, so basically it's a PC
> with a compact flash drive. The problem is that the compact flash is
> rather limited in speed and size (there is other stuff on it too).
>   
Oh ok. Well just keep in mind that 4GB of flash memory can be bought in 
China for about 5 euros.

Since programming time is pretty expensive you need to do your sums 
about where you want to spend the time/money.
>>> Or is there a method to have gzipped modules that are unzipped on
>>>       
> the 
>   
>>> fly into memory when they're accessed? That would be even better.
>>>       
>> Yes - also possible.
>>     
>
> That sounds promising, is there a link you can give? Or do I have to
> modify the module loading code for this, i.e. the interpreter? 
http://squashfs.sourceforge.net/
> I think
> that wouldn't be too much of a problem if I understand where Python
> loads modules; I haven't checked the Python source yet for that one, and
> searching for Python and zip or similar always yields tons of links that
> use the Python zip or tar module :)
>   
Python modules are byte compiled. You can usually cut out a lot/some of 
space by removing the source (.py) and leaving the compile (.pyc) modules.

There is usually a lib or a sitelib directory. You could try cleaning 
that out of unwanted modules.

My advice would be to simply buy higher capacity flash memory....

Regards

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080715/3738fbea/attachment-0001.html>


More information about the Python-list mailing list