pyinstaller:https://github.com/pyinstaller/pyinstaller/
(This file can automatically install dependencies, other versions seem to install dependencies themselves)
Unzip to a folder after download, 1 is the extracted file
Figure 1-Pyinstaller folder after decompression
The setup.py file will be seen in the folder after the decompression is complete.
Enter file directory from cmd, "
Install setup.py
will prompt to load ... The dependent files Pywin32 and pywin32 dependent files are automatically downloaded in the case of automatic networking ...
Finally, the installation is successful, this time can be used ...
D:\pyinstaller\pyinstaller-develop>python pyinstaller.py--console--onefile wdf.py
D:\pyinstaller\pyinstaller-develop is the Pyinstaller file directory to enter
wdf.py is the file I want to pack, just put it in the same folder in pyinstaller.py.
After the run is complete, a WDF folder appears in the current folder
The above compiled EXE can run normally, but with a black console, the following recompile, add--windowed--icon, cancel--console
D:\pyinstaller\pyinstaller-develop>python pyinstaller.py- w --onefile--icon="My.ico " wdf.py
Icon is a file of icons, PY is the program to be packaged. Finally generate a wdf.exe executable file, click Wdf.exe to display the drawing.
Python program packaged as EXE (using Pyinstaller)