exporting imports to reduce exe size?

Ron_Adam radam2_ at _tampabay.rr.com
Wed Apr 13 14:24:59 EDT 2005


On Tue, 12 Apr 2005 12:14:38 -0400, Chris Cioffi
<evenprimes at gmail.com> wrote:

>My first thought is what if the function you are using uses other
>functions(maybe not exported by the module/package)?  For example:  if
>some_func() makes a call to _some_weird_module_specific_func(), how
>are you going to make sure you get the
>_some_weird_module_specific_func function?  This doesn't even start to
>work when the function you are interested in is also using functions
>from other modules/packages.
>
>Besides, what py2exe is really doing is grabbing the .pyo or .pyc
>files and throwing them in a zip file.  Is it really worth the effort
>to save a 100K or so, at most?
>
>Chris
>

I think in some cases it could save quite a lot more than 100k when
you consider that the module you include to get a single function,
then may include 3 modules for other functions you don't need, and
they in turn do the same.

After looking into it some, I agree it's probably not worth the
effort.  Pythons pickle, shelve, and marshal functions don't work on
most module objects, so it's pretty much a dead end.

It would need be doable in a simple and general way to be worth while.

Thanks anyways,

Ron




More information about the Python-list mailing list