Home >Backend Development >Python Tutorial >How to make python executable file
Executable file (executable file) refers to a file that can be loaded and executed by the operating system. In different operating system environments, executable programs are presented differently. Under the Windows operating system, the executable program can be an .exe file, a .sys file, or a .com type file.
The following takes the exe file as an example:
First enter py2exe and download the plug-in. Pay attention to the downloaded plug-in version. Must be consistent with your own python version.
Then write a python code script, which mainly implements the printing function from 1 to 9.
Related recommendations: "python video tutorial"
Then enter cmd on the local computer, and then enter the specified python directory Run the python test code file.
Then write a setup script. The script file is named setup.py and placed in the same directory as the previous Ttest.py.
Then execute the following code python setup.py py2exe in cmd.
The main function of this code is to generate the .exe file, and then you can find the Ttest.exe file under dist.
The above is the detailed content of How to make python executable file. For more information, please follow other related articles on the PHP Chinese website!