*Newbie Question* --> Is it viable to distribute Python apps over the Internet?

Greg Brunet gbrunet at nospamsempersoft.com
Mon Apr 21 15:16:31 EDT 2003


"Denis Agar" <canrocks at yahoo.ca> wrote in message
news:25a672ee.0304210914.1cc2049c at posting.google.com...
> I'm blabbering! Anyway, my problem is this. I tried to compile a
> simple Hello World program into something runnable on non-python
> computers, and it came out being 7MB in size. Is there something I'm
> doing wrong? Just so you know, I do know somewhat what I'm doing. I
> know that it's incorporating all of the GUI. So is there a way to not
> incoporate all of the gui, and still have a functional program? I'm
> thinkin in the 800k range for a simple program? The reason I ask is
> because I'm thinking of porting something I made in VB to Python
> before I develop it any further.
>
> PS: The program is 92k in Visual Basic.

Realize that VB has a runtime as well, and if you packaged all of the
supporting files with it that are needed, (and probably already on your
computer), it would likely be in the same range as your 7 MB.  To more
closely compare apple to apples, I would recommend doing the following:
two install/setup programs.  The first with Python and your GUI support
files (in my case wxPython), the second with the required scripts
(packaged using Py2exe or comparable tool).

The first setup program would be comparable to VBRun60.exe which
contains the VB runtime files (though it doesn't include 3rd party OCX's
which can also get quite large).  My version of this has: python22.dll,
wxc.pyd, & wxmsw233h.dll. (or uh.dll) Packaged in a setup program
(compressed), they are about 2 MB.  As long as you don't change versions
of python of wxPython, this setup file could be shared among your
applications.

The second setup program would have your script (converted to an EXE so
that people can just run it without having to load the entire python
environment).  Even with all of the supporting scripts that will come
along in the package, this should only be 1/2 meg in size, maybe less.
In my tests, a fair amount of this size comes from the supporting
wxpython PYC files, which, with a little extra work, could be packaged
into the first setup program.

If you look at it this way, you'll end up with something comparable to
your VB experience.  For a more detailed example of all this, check out:
http://wiki.wxpython.org/index.cgi/SmallApp

-- 
Greg






More information about the Python-list mailing list