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!