Python program to exe executable file

Python program to exe executable file

1. Install PyInstaller

​ PyInstaller is a Python packaging tool that can be used to package Python programs into an independent executable software package.

​ The installation method of PyInstaller is as follows:

​ (1) Open cmd and enter pip install PyInstaller;

​ (2) After the installation is complete, enter pyinstaller --versionit in cmd . If there is no error message, the installation is successful.

2. Use PyInstaller

​ Open cmd, enter the folder, and execute the following code:

pyinstaller -F -w -i main.ico main.py

​ -F means to generate a single executable file

​ -w means to remove the console window, which is very useful in the GUI interface (if it is a command line program, delete this option)

​ -i represents a chart of executable files

​ This generates an executable file in the dist directory.

Guess you like

Origin blog.csdn.net/NickHan_cs/article/details/108110331