"Turn" http://www.cnblogs.com/belid/archive/2013/05/03/3056854.html
Introduction to installation and use of a py2exe
1.py2exe installation, Http://prdownloads.sourceforge.net/py2exe Select the corresponding Python version to install
2. Use, create a new setup.py file
#coding =utf-8from distutils.core Import setupimport py2exeincludes = ["Encodings", "encodings.*"]options = {"Py2exe": {" Compressed ": 1," optimize ": 2," ASCII ": 1," includes ": Includes," Bundle_files ": 1 #只生产一个exe文件}}setup (name=" Setup.exe ",
Options=options,
Zipfile=none, #不生成zip文件
console=["setup.py"])
Then go to directory in the execution of Python setup.py Py2exe, will generate a build and dist directory, in the Dist directory has setup.exe program.
Introduction to installation and use of two Pyinstaller
1. Install a dependency package for Pyintaller, http://sourceforge.net/projects/pywin32/files/.
2. Go to http://www.pyinstaller.org/download Pyintaller, then unzip.
3. Go to unzip directory to execute Python configure.py (first use only)
4. Enter the directory of the program to execute Python pathtopyinstaller/makespec.py-f setup.py generate the Setup.spec file. -F is to produce only one executable program.
5. Executing python pathtopyinstaller/build.py setup.spec generates a setup.exe executable in the Dist directory.
Pathtopyinstaller Installing the Pythoninstall path
"Go" Python pack Py2exe and Pyinstaller