making executables smaller

Wildman best_lay at yahoo.com
Tue Jul 26 14:47:27 EDT 2016


On Tue, 26 Jul 2016 12:22:16 -0500, Carter Temm wrote:

> Hi,
> I’m writing a couple different projects at the moment, and when I
> compile it into a single executable using pyinstaller, it becomes
> extremely large. I’m guessing this is because of the modules used.
> Because I’m not that skilled at python, I put stuff like for example,
> import sys. I imagine the final project could be made smaller by
> specifying from something import something_else. but the thing is,
> I don’t know what smaller I could import with these set of modules.
> Is there a program that could tell me this. Sorry if this question
> is really basic, but it’d be helpful.

Try importing only the modules you actually use.
For example, instead of:

    import os

Try using:

    import os.path
    import os.environ
    import os.whatever

-- 
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!



More information about the Python-list mailing list