White learn Python (19): Pyinstaller generate exe files

python PyInstaller default does not include modules, it is necessary to install their own PyInstaller module.


Installation PyInstaller module and install additional Python modules, you can use the command to install pip. At the command line command as follows:

 

pip install pyinstaller

 

It is strongly recommended use pip to install PyInstaller online installation module, do not use the offline way to install the package, because PyInstaller module also rely on other modules, pip when installing PyInstaller module will first install its dependencies module.

 

After PyInstaller module is installed successfully, in the installation directory of the Python  Scripts(D:\Python3\Scripts) directory will add a pyinstaller.exe program, then you can use this tool to generate EXE program of the Python program. 

 

 

 

App.py ready to produce their own documents, such as

 

PyInstaller generate exe files

pyinstaller  -F  E:\app\name.py

 

Wherein the parameter is -F, one could write, as pyinstaller.py -F -w C: \ python \ login.py

Definition:

-F Specifies the package only after generating an exe file format
-D -onedir create a directory that contains exe file, but a lot will depend on the file (the default option)
-c the -console, -nowindowed using the console, no interface (default)
- w -windowed, -noconsole use the window, no console
add search path -p, let it find the corresponding library.
-i generation program icon change icon


 E: \ app \ name.py    for the path and file name that you want to convert the file, you can put py file in the scripts path of the python path, so you can omit the path, direct write the file name XX.py

Wait for the end of the run, if there are no errors, EXE file creates a file in the Scripts folder dist python installation path of the folder in the folder , such as D: \ python \ Scripts \ dist .

 

 

 

Double-click to open the program.

 

pyinstaller  -F  E:\app\name.py

 

Wherein the parameter is -F, one could write, as pyinstaller.py -F -w C: \ python \ login.py

Definition:

-F Specifies the package only after generating an exe file format
-D -onedir create a directory that contains exe file, but a lot will depend on the file (the default option)
-c the -console, -nowindowed using the console, no interface (default)
- w -windowed, -noconsole use the window, no console
add search path -p, let it find the corresponding library.
-i generation program icon change icon


 E: \ app \ name.py    for the path and file name that you want to convert the file, you can put py file in the scripts path of the python path, so you can omit the path, direct write the file name XX.py

Wait for the end of the run, if there are no errors, EXE file creates a file in the Scripts folder dist python installation path of the folder in the folder , such as D: \ python \ Scripts \ dist .

 

Guess you like

Origin www.cnblogs.com/adam012019/p/11404827.html