pyinstaller.exe packages .py files into exe files

Use pyinstaller to convert python program .py into .exe executable file

while installing pyinstaller

1. Execute in the python directory, assuming that pip has been installed, use pip.exe install PyInstaller  

Another advantage of using pip to install is that pip will automatically install the dependent modules required by this third-party package (for example, we downloaded the pypiwin32 dependency here). No, it's a lot easier

After the installation is complete, there will be a file in the same directory, you need to jump to the script directory to execute the pyinstaller.exe file 

PyInstaller uses

Execute the command -- pyinstaller.exe [-option] yourname.py    

1.1 Option options include:
-F, -onefile package into an exe file
-D, -onedir create a directory containing exe files, but will depend on many files (default options)
-c, -console, -nowindowed use console, none interface (default)
-w, -windowed, -noconsole use window, no console

2 Compile the .py file to be converted into a .exe file, and finally compile it successfully

2.1 -F,-onefile package into an exe file

Pyinstaller.exe -F –w yourname.py (generates .exe file, no cmd console)

2.2   Pyinstaller.exe  --console --onefile  yourfile

Generate only one file .exe (with console cmd window)

 

Pyinstaller.exe  --console -D  yourfile

2.2         

2.3          

 

2. There will be a dist file generated in the directory, which is the target file

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325572481&siteId=291194637