Skip to content
Advertisement

Make a python file an executable

Is there a way to make an executable from a python file, but not load the python interpreter? Both py2exe and pyinstaller do this. Is there another library that doesn’t?

Advertisement

Answer

Try Nuitka. It converts python code into C, and then compiles that into an executable. It is also faster than the regular CPython.

Nuitka is already slightly faster than CPython, but there is work to be done to include as many C optimizations as possible. We currently get a 312% speedup in pystone, which is a good start. (source: Nuitka version 0.6.0 with Python 2.7.)

Note: this works with both python 2 and 3

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement