Use Pyinstaller to package Python code as an EXE executable file

Source: Internet
Author: User

Advantages:
1. Pyinstaller is cross-platform and can be used on Linux and Windows systems
2. The operation is very simple, a few commands are done, this is more than py2exe easier to use

Disadvantages:
1. After packing the volume is too large, because to bring Python.dll library, so there is no way
2. Can not and tkinter and other libraries, packaged into a separate file

1. Download Pyinstaller

Currently Pyinstaller supported Python version is 2.3-2.7, can be downloaded to http://www.pyinstaller.org/official website.

2. Installation

After the download is complete, unzip it.

3. How to use Pyinstaller

Use is also very simple, cmd under the extracted directory, execute the following command.

Python pyinstaller.py [opts] yourprogram.py

The main options are:

----w,–windowed,–noconsole using Windows, no console
-X Shell the program with UPX

Such as:

Python pyinstaller.py-f-c-x aaa.py

Note: If you are prompted to install Pywin32, you can download the installation to http://sourceforge.net/projects/pywin32/files/pywin32/.

Use Pyinstaller to package Python code as an EXE executable file

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.