Little tool - but very big size... :-(

D

Durumdara

Hi !

I have a problem.
I have a little tool that can get data about filesystems and wrote it in
python.

The main user asked me a GUI for this software.

This user is needed a portable program, so I create this kind of the
software with Py2Exe.

But it have very big size: 11 MB... :-(

The dist directory:
2006.02.21. 10:09 <DIR> .
2006.02.21. 10:09 <DIR> ..
2005.09.28. 12:41 77 824 bz2.pyd
2006.02.21. 10:09 0 dirlist.txt
2006.02.20. 12:51 611 384 library.zip
2006.02.15. 16:22 23 558 main.ico
2004.12.16. 17:22 348 160 MSVCR71.dll
2005.09.28. 12:41 1 867 776 python24.dll
2006.01.11. 12:19 102 400 pywintypes24.dll
2005.09.28. 12:41 405 504 unicodedata.pyd
2005.09.28. 12:41 4 608 w9xpopen.exe
2006.01.11. 12:19 73 728 win32api.pyd
2006.01.11. 12:20 81 920 win32file.pyd
2006.01.11. 12:26 106 496 win32security.pyd
2006.01.10. 19:09 4 943 872 wxmsw26uh_vc.dll
2006.02.20. 12:51 40 960 wxPyHDDirList.exe
2005.09.28. 12:41 69 632 zlib.pyd
2006.01.10. 19:13 626 688 _controls_.pyd
2006.01.10. 19:12 696 320 _core_.pyd
2006.01.10. 19:13 364 544 _gdi_.pyd
2006.01.10. 19:13 491 520 _misc_.pyd
2006.01.10. 19:13 548 864 _windows_.pyd
20 file 11 485 758 byte

I need to have more compressed result. Can I compress dll-s, pyd-s with
Py2Exe ?
Can I decrease the total size with something ?

If not, how to I create an self-unpackager and self-starter program that
use an temporary directory in the disk ? With WinRar ?

Thanx for help:
dd
 
R

Ravi Teja

Dependency tracking is usually not perfect in exe generators. I don't
recall how good py2exe is at this. If you understand which of those
files will not be used by your program, you can safely delete them. A
bit of trial and error here if you are not sure. Unless you are using
floppies or dialup to transfer this tool, you should simply not worry
about the file size.

As for compression, just use an installer builder like Inno Setup
http://www.jrsoftware.org/isinfo.php
http://www.istool.org/default.aspx/
 
D

Durumdara

Hi !

Yes, it is. But that tool is designed for USB PenDrive usage.
The assessor is collect all tools it needed to see a machine(s) in the
checked corporation.
He/she needs little programs, because he need to store the results of
the checkings too, not the tools only.

So I need to minimalize the code size.

Thanx for help:
dd
 
B

bonono

I doubt you can do much then as you mentioned you need GUI which is why
there is the GUI related dll in the list(takes a large chunk of it),
then the necessary python runtime.

However, even for USB pen, I don't think 11M is that much a big deal.
We have digicam that can produce file size like that so finding a large
pen drive is not much of an issue. Worse come to worse, convince him to
use a 2.5" USB drive container. It is a bit bigger than USB pen drive
but can give you 20G+ without external power, just as convenient as a
pen drive.
 
G

Giovanni Bajo

Durumdara said:
I need to have more compressed result. Can I compress dll-s, pyd-s
with Py2Exe ?
Can I decrease the total size with something ?

If not, how to I create an self-unpackager and self-starter program
that use an temporary directory in the disk ? With WinRar ?


You can use PyInstaller (http://pyinstaller.hpcf.upr.edu). PyInstaller easily
builds a single executable with everything inside it. It also optionally
compresses everything with UPX (http://upx.sourceforge.net/) so to reduce the
size at the maximum.

There are also other choices that can be made. For instance, wxWidgets is
*HUGE*.
 
M

Mikael Olofsson

Durumdara said:
But it have very big size: 11 MB... :-(

The dist directory:
[snip relatively small files]
2005.09.28. 12:41 1 867 776 python24.dll
[snip relatively small files]
2006.01.10. 19:09 4 943 872 wxmsw26uh_vc.dll
[snip relatively small files]
20 file 11 485 758 byte

I need to have more compressed result. Can I compress dll-s, pyd-s with
Py2Exe ?
Can I decrease the total size with something ?

I've snipped out the relatively small files above. Yes, true, some of
them consume about 0.5MB each.

It seems to me that your choice of GUI framework is a major cost here. I
have never used wxpython. Instead my GUIs are based on tkinter. What I
typically end up with is roughly 7MB. My last example ended up in 7.5MB.
Zipping the whole thing reduces that to 2.6MB. Is it completly out of
the question to have a compressed version of the tool on your memory
stick, and to decompress it on the examined computer before actually
running the tool?

/MiO
 
?

=?ISO-8859-1?Q?Gerhard_H=E4ring?=

Durumdara said:
Hi !

Yes, it is. But that tool is designed for USB PenDrive usage.
The assessor is collect all tools it needed to see a machine(s) in the
checked corporation.
He/she needs little programs, because he need to store the results of
the checkings too, not the tools only. [...]

Additional Python or wxPython tools packed using py2exe will only need a
few kilobytes if you all copy them to the same directory on the pen
drive. All these tools can share the same .pyd and .dll files.

-- Gerhard
 
D

Durumdara

Hi !
I've snipped out the relatively small files above. Yes, true, some of
them consume about 0.5MB each.

It seems to me that your choice of GUI framework is a major cost here. I
have never used wxpython. Instead my GUIs are based on tkinter. What I
typically end up with is roughly 7MB. My last example ended up in 7.5MB.
Zipping the whole thing reduces that to 2.6MB. Is it completly out of
the question to have a compressed version of the tool on your memory
stick, and to decompress it on the examined computer before actually
running the tool?

/MiO
Yes, the wxPython use the big files, and win32api do it too...
I need them, but wxPython is changeable to tkinter, because it is use
only one special thing: a wx.GenericDirCtrl (the user can choose file or
directory with this control in same way).

The last (compressed) version is 5 MB. That is better !

Thanx: dd
 
L

Larry Bates

Since the target is Windows only, consider using win32gui
(part of Mark Hammonds win32 extensions) calls to use
native Windows controls. That way you can eliminate
wxWindows altogether. If all you need is a file dialog,
it isn't very difficult.

-Larry Bates


Mikael said:
Durumdara said:
But it have very big size: 11 MB... :-(

The dist directory:
[snip relatively small files]
2005.09.28. 12:41 1 867 776 python24.dll
[snip relatively small files]
2006.01.10. 19:09 4 943 872 wxmsw26uh_vc.dll
[snip relatively small files]
20 file 11 485 758 byte

I need to have more compressed result. Can I compress dll-s, pyd-s with
Py2Exe ?
Can I decrease the total size with something ?

I've snipped out the relatively small files above. Yes, true, some of
them consume about 0.5MB each.

It seems to me that your choice of GUI framework is a major cost here. I
have never used wxpython. Instead my GUIs are based on tkinter. What I
typically end up with is roughly 7MB. My last example ended up in 7.5MB.
Zipping the whole thing reduces that to 2.6MB. Is it completly out of
the question to have a compressed version of the tool on your memory
stick, and to decompress it on the examined computer before actually
running the tool?

/MiO
 
B

BJ in Texas

(e-mail address removed) wrote:
|| 11MB is seldom a concern for today's machine.
||

A good windows/microsoft attitude.. :)
 
P

Peter Hansen

Larry said:
Since the target is Windows only, consider using win32gui
(part of Mark Hammonds win32 extensions) calls to use
native Windows controls. That way you can eliminate
wxWindows altogether. If all you need is a file dialog,
it isn't very difficult.

A good point, and one the developer of Venster thought of as well, since
he's already done much of this work (and without even requiring
win32gui, as he went through the lighter-weight ctypes).
http://venster.sourceforge.net/htdocs/index.html

(I haven't tried using this myself, but there's an 800K example of a
Windows GUI app included on that page for download.)

-Peter
 
S

Sion Arrowsmith

BJ in Texas said:
(e-mail address removed) wrote:
|| 11MB is seldom a concern for today's machine.
A good windows/microsoft attitude.. :)

I wish 8-( :

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3715 root 15 0 288m 128m 154m S 1.0 6.3 14902:42 XFree86
735 <user> 15 0 156m 84m 40m S 0.3 4.2 3:55.48 firefox-bin
3533 root 16 0 85652 74m 1572 S 0.0 3.7 0:00.22 pcscd
3904 <user> 15 0 67768 49m 17m S 0.3 2.4 4:48.16 gnome-terminal
449 <user> 16 0 58484 41m 39m S 0.0 2.1 16:18.60 kmail
4010 <user> 16 0 49056 34m 22m S 0.0 1.7 0:01.63 kdeinit
31724 <user> 16 0 94708 32m 34m S 0.0 1.6 0:49.03 epiphany
3892 <user> 15 0 41696 22m 19m S 0.0 1.1 0:20.60 nautilus
28992 <user> 15 0 57984 19m 22m S 0.0 1.0 5:53.66 kdeinit
3902 <user> 16 0 26948 18m 11m S 0.0 0.9 1:50.81 xemacs
4237 <user> 15 0 29784 15m 22m S 0.0 0.8 0:01.24 python
444 <user> 16 0 24384 15m 20m S 0.0 0.7 0:08.99 gaim
4026 <user> 15 0 29924 14m 28m S 0.0 0.7 0:12.59 kdeinit
4012 <user> 16 0 27352 14m 25m S 0.0 0.7 0:33.24 kdeinit
5388 <user> 15 0 26008 13m 24m S 0.0 0.7 0:02.06 kdeinit
350 <user> 15 0 20456 12m 17m S 0.0 0.6 0:05.05 gnome-panel
 
M

Max

Giovanni said:
There are also other choices that can be made. For instance, wxWidgets is
*HUGE*.

Indeed. Remember Tkinter is built-in. (I never got the hang of Tkinter
and prefer wx, but if size is important...)

--Max
 
?

=?ISO-8859-1?Q?Gerhard_H=E4ring?=

Max said:
Giovanni said:
There are also other choices that can be made. For instance, wxWidgets is
*HUGE*.

Indeed. Remember Tkinter is built-in. [...]

Tkinter is only built-in in the sense that it's shipped with Python by
default. It is not automatically part of a minimal Python runtime that's
created with py2exe or a similar tool.

A Tkinter hello weights here 1,95 MB (2.049.264 Bytes)

compared to the small wxPython tool that I compressed recently: 2,80 MB
(2.942.543 Bytes)

All self-extracting LZMA compressed archives using 7ZIP.

-- Gerhard
 
F

Felipe Almeida Lessa

Em Qua, 2006-02-22 às 21:38 +0100, Gerhard Häring escreveu:
A Tkinter hello weights here 1,95 MB (2.049.264 Bytes)

compared to the small wxPython tool that I compressed recently: 2,80 MB
(2.942.543 Bytes)

What about PyGtk? Does anybody have any figures? I can't test here =(...

--
"Quem excele em empregar a força militar subjulga os exércitos dos
outros povos sem travar batalha, toma cidades fortificadas dos outros
povos sem as atacar e destrói os estados dos outros povos sem lutas
prolongadas. Deve lutar sob o Céu com o propósito primordial da
'preservação'. Desse modo suas armas não se embotarão, e os ganhos
poderão ser preservados. Essa é a estratégia para planejar ofensivas."

-- Sun Tzu, em "A arte da guerra"
 
G

Giovanni Bajo

Felipe said:
What about PyGtk? Does anybody have any figures? I can't test here
=(...

I have a custom compilation script for PyQt which can package Qt 3.3.5 Core +
OpenGL + Table in a single .pyd of 1.2Mb (compressed). You can add to that the
usual Python overhead (around 1Mb compressed), thanks to having those useless
CJK codecs compiled within python24.dll (sigh!).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,970
Messages
2,570,162
Members
46,710
Latest member
bernietqt

Latest Threads

Top