Valhalla Legends Forums Archive | General Programming | [Python] regarding py2exe

AuthorMessageTime
Topaz
After I've compiled the modules into an exe, the end result seems to be rather large; about 3mb's worth of dependencies, and the actual file is only 14kb!

So - what can I do to reduce the size to an acceptable range (70-180kb)?
May 17, 2006, 5:20 AM
rabbit
UPX or something of the sort.
May 17, 2006, 2:22 PM
Yegg
I'm guessing that it is because you imported some very large modules.

From your Python code, show us what you imported.
May 17, 2006, 8:01 PM
Topaz
[quote]
print "hello world!"
[/quote]
May 17, 2006, 10:25 PM
Yegg
That's odd. I never had that issue. Not really sure what to say, other than asking on forums.devshed.com.
May 17, 2006, 11:08 PM
Topaz
Well, for starters, python24.dll and msvcr71.dll are about 2.5mb's together. If I try to remove one or the other or both, it doesn't run properly.

rabbit: I can't pack python-related files, the error says something about an unexpected value in the PE header.
May 17, 2006, 11:46 PM
St0rm.iD
It's because the interpreter is embedded in the exe.
May 18, 2006, 3:09 AM
Topaz
[quote author=Banana fanna fo fanna link=topic=15000.msg152668#msg152668 date=1147921745]
It's because the interpreter is embedded in the exe.
[/quote]

So this is an inescapable problem? =[
May 18, 2006, 3:27 AM
St0rm.iD
Simplistically? Yes.
May 18, 2006, 4:55 AM
Topaz
Oh yeah, update: apparently I was using an older version of UPX, because when I upgraded to 2.0, I could pack them! yay! Total filesize is 1.37mb, which is a significant improvement.
May 18, 2006, 6:10 AM
Yegg
[quote author=Topaz link=topic=15000.msg152675#msg152675 date=1147932648]
Oh yeah, update: apparently I was using an older version of UPX, because when I upgraded to 2.0, I could pack them! yay! Total filesize is 1.37mb, which is a significant improvement.
[/quote]

I remember having a program with more code than your hello world, and PY2EXE sent it back to me as a ~60kb file. Still not sure why yours is so large.
May 18, 2006, 8:12 PM
Topaz
I'm using python 2.4 = could that be why?
May 18, 2006, 10:27 PM
Yegg
[quote author=Topaz link=topic=15000.msg152708#msg152708 date=1147991277]
I'm using python 2.4 = could that be why?
[/quote]

Well, when I last actually used Python the latest version was 2.3. I don't see how 2.4 would change anything, but you never know. Like I said, forums.devshed.com may have a better answer, it's worth a try.
May 19, 2006, 12:45 AM

Search