473,804 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make python24.dll smaller ?

Hello,

I am trying to make an executable for one of my applications with cx
freeze. All works ok although I must include python24.dll with it if I
want to redistribute it. The big problem is python24.dll size, it's 1.8
MB and I am sure I don't need much of what's in there.

I downloaded python source code and built the dll using the VC 7.1
project (directory PCBuild/), still can't figure out how I can tweak
the project so I get smaller dll - for example is there a way to find
out what modules are included, what is the approx size they take inside
the dll and how can I not include them by default ?

Thanks,
Andrei

Sep 14 '05 #1
2 2264
Ok, for anyone interested on the issue: I have found the solution. I
commented out some module lines inside config.c (modules I know for
certain I will not use) and removed the module .c files from the
project.

Biggest save was when I removed the Asian character encodings, reduced
size by about 650 KB.

I also changed the build options to link against multithreaded libs,
not multithreaded dll libs (which makes python24.dll dependent on
msvcr71.dll which in turn is not present on some people's computers and
would have to be distributed in that case).

Final result: a 1.1 MB python24.dll which works with my frozen apps and
is not dependent on msvcr71.dll and compressed goes to around 440 KB.
And I'm sure that depending on the project I still could trim some more
modules out.

Andrei

Sep 14 '05 #2
Stormbringer wrote:
Final result: a 1.1 MB python24.dll which works with my frozen apps and
is not dependent on msvcr71.dll and compressed goes to around 440 KB.
And I'm sure that depending on the project I still could trim some more
modules out.


If you are building yourself, anyway, I recommend an even more drastic
approach (which, alas, requires more work also): build a static library
for all the extension modules, and then use freeze to generate the
config.c. Linking it all together will bring in just those modules which
are actually referenced in config.c, and freeze will guess what modules
to put into config.c based on import statements. You might be able
to trim it further by explicitly excluding modules on the freeze command
line if you happen to know that some import statements are never
executed in your application (this is actually worthwhile for the
Python modules as well).

Regards,
Martin
Sep 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1181
by: Jose Rivera | last post by:
Hi I changed for python24 and the only thing missed is metakit for python24. Thanks
24
3738
by: Robin Becker | last post by:
Investigating a query about the python path I see that my win32 installation has c:/windows/system32/python24.zip (which is non existent) second on sys.path before the actual python24/lib etc etc. Firstly should python start up with non-existent entries on the path? Secondly is this entry be the default for some other kind of python installation? -- Robin Becker
3
1592
by: Robert | last post by:
updating a py2exe'd software I was impressed by python24.dll's footprint - double size of python23.dll Is there a version without/separate asianc codecs (which seem to mainly blow up python24.dll)? Or how to build one? Robert
1
1479
by: Robert | last post by:
Martin v. Löwis schrieb: > Robert wrote: > > Wouldn't it be an issue to think about if future win-python distributions > > should keep on including the asian codecs in the main-dll? > > Indeed, it would. As I said before: if somebody defines a clear, fair > policy which finds agreement in the community, I'm willing to change the > current policy on what goes into python24.dll, and what is built > separately. Bonus points if the policy is...
12
2234
by: a | last post by:
def fn(): for i in range(l) global count count= .... how do i declare count to be global if it is an array subsequently i should access or define count as an array error:
15
6541
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt accept other controls. The control i drag drop on it becomes the child of my custom control's parent form and not the child of my custom control. Then i added this line "" before my custom control class (i dont know what this line does). Now
7
1861
by: Jonathan Fine | last post by:
Hello My problem is that I want a Python 2.4 module on a server that is running Python 2.3. I definitely want to use the 2.4 module, and I don't want to require the server to move to Python 2.4. More exactly, I am using subprocess, which is new in Python 2.4. What I am writing is something like
9
2454
by: korean_dave | last post by:
From command Prompt, i type in a script, "tryme.py". This, instead, brings up PythonWin editor and Interactive Window. Path variable is "C:\Python24". (I need Python 2.4 installed, not 2.5) How do I make it so that the script runs?
5
4693
by: zxo102 | last post by:
Hi, I am trying to use python module smtplib to send my email out on window xp (localhost). import smtplib server = smtplib.SMTP('localhost') but I got the error information as follows: Traceback (most recent call last):
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10356
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10361
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9179
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7644
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.