Jump to content

Python - py2exe: Difference between revisions

From Torben's Wickie
mNo edit summary
 
mNo edit summary
 
Line 4: Line 4:


  pyinstaller --onefile --console your.py
  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: [http://www.py2exe.org py2exe]
===Command line scripts===
see [http://www.py2exe.org/index.cgi/Tutorial 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 [http://www.py2exe.org/index.cgi/Py2exeAndPyQt 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

Latest revision as of 13:41, 25 October 2026

pyinstaller

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