Python - py2exe

From Torben's Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

pyinstaller

pip install pyinstaller
pyinstaller --onefile --console your.py


as of 07.01.2019: py2exe works only for python <= 3.4

py2exe converts .py -> .exe in order to run on computers with no python installed

Download and install it form here: py2exe

Command line scripts

see py2exe Tutorial

create a file called setup.py:

from distutils.core import setup
import py2exe
setup(console=['myScript.py'])  # <---- change this

now run

python setup.py py2exe

Gui using Qt

see Py2exeAndPyQt create a file called setup.py:

from distutils.core import setup
import py2exe
setup(windows=[{"script" : "myScript.py"}], options={"py2exe":{"includes":["sip"]}})

now run

python setup.py py2exe