python to 可执行文件
- cx_Freeze for Windows, Linux, and Mac OS X (Python 2.7, 3.x)
- pyinstaller for Windows, Linux, and Mac OS X (Python 2.7, 3.3-3.5)
- bbfreeze for Windows and Linux (Python 2.4-2.7)
- py2exe for Windows (Python 2.6, 2.7)
- py2exe for Windows (Python 3.3-3.5)
- Freeze for Linux and maybe Mac OS X (Python 2.x)
- py2app for Mac OS X (Python 2.x)
py2exe for python2.7
pip install py2exe_py2
py2exe for python3.3~
pip install py2exe
假设有一个test.py 的需要一个转换的文件;
写一个gen.py ,将test.py填入 setup(console) 处:
from distutils.core import setup import py2exe setup( console=['test.py'], zipfile = None, options = {'py2exe' : { "bundle_files": 1, "dll_excludes": ["MSVCP90.dll","w9xpopen.exe"] } }
在同一目录执行:
python gen.py py2exe
生成一个比较大的可执行文件,在目录 dist 下;