Python - py2exe

From Torben's Wiki
Jump to: navigation, search

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
Personal tools