Using Python to convert a py file to an exe file that does not depend on the python Environment

Source: Internet
Author: User

In daily work, python scripts are used for rapid and agile development, but their code is visible and fully dependent on the python development environment. To protect our source code, or use a python script without relying on the python development environment, it is particularly important to convert it into an exe file that can be directly run.

The omnipotent python, the open-source python is so robust that the py2exe module is born for this function! Click here.

The following is an example of its usage:

(=

Now, the preparation is complete, and py2exe is on the stage:

Distutils. core = {: 1 = [{: =

Run py2exeSample_py2exe.py directly, and then generate the exe file we need. The exe file is located in the dist folder under the current directory! Copy them to any computer you need!

With py2exe, Ma no longer has to worry about leaking my code or installing the python environment on the computer!

Thank you for reading this article. I hope it will help you!

Published by Windows Live Writer!

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.