Distributing Python apps

Thomas Heller theller at python.net
Mon Jan 6 20:38:21 CET 2003


Richie Hindle <richie at entrian.com> writes:

> [David LeBlanc]
> > Taking a quick glance at just Python, I don't think your goal of putting
> > Python + app + data on a single 1.44mb floppy is realistic.
> 
> But the OP doesn't need to do that - he only needs to ship the pieces
> his application needs, which py2exe will extract and InnoSetup will
> compress.
> 
> > In terms of a download, I'm betting that 2+mb for a runtime only including
> > application bytes (binaries and doc) is more likely.
> 
> A small but non-trivial Python program, 'compiled' with py2exe and
> packaged with InnoSetup, should total less than a megabyte.  Adding a
> GUI toolkit will probably take that beyond the 1.44MB mark, but Norm
> said "I don't want to deliver on a CD or a floppy.  I want to deliver by
> ftp."
> 
> For example, a small CGI script called 'xxx.py', which relies on a few
> Python standard library modules including 're' and 'socket', compiles
> using py2exe to this:
> 
>  292643 Dec 11 09:43 xxx.exe
>  847920 Oct 14 18:02 python22.dll
>   45103 Oct 14 18:02 _socket.pyd
>   53292 Oct 14 18:03 _sre.pyd
>   36864 Oct 14 18:03 _winreg.pyd
> 
> That totals 1,275,822 bytes uncompressed.  The resulting InnoSetup
> installer, built with all the default options, is 965,948 bytes.  This
> is with Python 2.2.2.
> 

To further cut down the file size, you could use UPX, which
transparently compresses executable files. This brings down
python22.dll from 847920 bytes to 324608 bytes. IIRC, the ratio
is even more impressive with the wxPython and wxWindows dlls.

http://upx.sourceforge.net/

Thomas




More information about the Python-list mailing list