Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make an EXE file from a Python program? [duplicate]

I've used several modules to make EXEs for Python, but I'm not sure if I'm doing it right.

How should I go about this, and why? Please base your answers on personal experience, and provide references where necessary.

like image 350
minty Avatar asked Sep 08 '08 03:09

minty


People also ask

Can you turn a Python file into an exe?

Fortunately, there are many Python utilities that help convert files from . py to .exe. They will “freeze” your code and build an executable file for you. Here we'll consider two of the most popular options: cx_freeze and PyInstaller.

Can you decompile a Python exe?

decompile-py2exe takes an executable as argument, extracts the Python bytecode and decompiles it with uncompyle6, all in one step. The executable can also be passed via stdin or inside a (password protected) ZIP file. Be sure to use Python 3 to run decompile-py2exe.

Does converting Python to exe make it faster?

No, not really. Since it's merely a wrapper it provides the necessary files needed to run your code. Using Cython could make your program run faster by being able to compile it using C.


1 Answers

Auto PY to EXE - A .py to .exe converter using a simple graphical interface built using Eel and PyInstaller in Python.


py2exe is probably what you want, but it only works on Windows.
PyInstaller works on Windows and Linux.
Py2app works on the Mac.

like image 122
Josh Segall Avatar answered Oct 31 '22 22:10

Josh Segall