Hack Forums
[Python] How can I compile my whole python script into 1 EXE - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] How can I compile my whole python script into 1 EXE (/showthread.php?tid=5882359)



How can I compile my whole python script into 1 EXE - White Partyhat - Sep 7, 2018

The thing is, it uses multiple python scripts in one, so it has some dependencies.

If anyone can help me out with this, it would be awesome.

Also looking to pay ~$10 if someone can get it done for me.

EDIT: I've tried cx_freeze, pyinstaller and py2exe, but couldn't get any of them to work for some reason.


RE: How can I compile my whole python script into 1 EXE - Dr. Lecter - Sep 7, 2018

Ever tried to compile it to .pyc ?


RE: How can I compile my whole python script into 1 EXE - White Partyhat - Sep 7, 2018

(Sep 7, 2018 05:35 AM)Dr. Lecter Wrote:  Ever tried to compile it to .pyc ?

I did, but I want a normal EXE


RE: How can I compile my whole python script into 1 EXE - Influxes - Sep 7, 2018

I have this same problem all the time. I am still looking into other ways. If you are worried about people seeing your src code, instead of making a .exe, you can make it a .pyc and then change the end from .pyc to .py and the code is changed. Of course it is easy to change it back and see the code.


RE: How can I compile my whole python script into 1 EXE - pedro6 - Sep 7, 2018

you can take help from linksys customer service


RE: How can I compile my whole python script into 1 EXE - SIM-3991524 - Sep 7, 2018

Either py2exe or pyinstaller. I have personal experience with py2exe, main drawback is that the build size is like 5mb (at least on windows)


RE: How can I compile my whole python script into 1 EXE - White Partyhat - Sep 8, 2018

(Sep 7, 2018 04:29 PM)pedro6 Wrote:  you can take help from linksys customer service

What has that got to do with anything?


RE: How can I compile my whole python script into 1 EXE - wtfrick - Sep 11, 2018

You can merge all of the dependencies into a single .exe using the --onefile parameter with py2installer. PM me your Discord if you still need help.


RE: How can I compile my whole python script into 1 EXE - silenceMeNow - Sep 12, 2018

pyinstaller -F -w Your_python_file.py


the -w parameter is used to hide the console and the -F paramter to compile it to one file


PyInstaller Docs (to see all the options):
https :// pyinstaller .readthedocs .io/ en/st able /usage .html #options