A detailed description of the Py2exe packaging tool in Python

Source: Internet
Author: User
The following small series for everyone to bring a Python py2exe packaging tools detailed. Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.

Download the Python version of Py2exe and use this tool to package your own programs as EXE files.

Use this tool to write a setup.py file for packaging (name can be self-determined, not necessarily setup.py), write well after the command prompt interface CD to the directory of this file, execute the command "python setup.py py2exe" can be packaged and finished.

The following is their own reference to other users to write, for reference:

# _*_ Coding:utf-8 _*_import py2exefrom distutils.core Import setupincludes = [' Encoding ', ' encodings.* ']options = {' py2e Xe ':        {' compressed ': 1,        ' optimize ': 2,        ' ASCII ': 1,        ' includes ': Includes,        ' bundle_files ': 1,        ' Dll_excludes ': [' MSVCP90.dll '],        }      }setup (version= ' 1.0.0 ',   description= ' search file ',   name= ' Search file ',   options=options,   zipfile=none,   windows=[{' script ': ' core\\tool.py ', # The path to the main files of the program that needs to be packaged        ' icon_resources ': [(1, ' Resource\\icon.ico ')], # Picture path of the icon of the program        }],   )
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.