"Go" Python pack Py2exe and Pyinstaller

Source: Internet
Author: User

"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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.