Does python come with its own library for packaging exe? The answer is that Python does not have its own library for packaging EXE, but you can install third-party modules to implement the function.
#pyinstaller packages Python scripts into executable EXE files.
The steps are as follows:
1. Download the corresponding pyinstall tool from the official website. I downloaded PyInstaller-3.2.1.zip and unzip it
2. Via cmd Jump to the pyinstaller directory and execute setup.py install to install. At this time, the necessary third-party packages will be installed to your python path. Of course, you don’t need to worry about the details
3. You can use it after the installation is successful.
TK-GUI.py is my source program
c:\PyInstaller-3.2.1>pyinstaller.py -F -w C:\Users\han.chunwang\PycharmProjects\
untitled\TK-GUI.py
....
62186 INFO: checking EXE
62186 INFO: Building EXE because out00-EXE. toc is non existent
62186 INFO: Building EXE from out00-EXE.toc
62187 INFO: Appending archive to EXE c:\PyInstaller-3.2.1\dist\TK-GUI.exe
62194 INFO: Building EXE from out00-EXE.toc completed successfully.
-F is the generated exe program, because the GUI program I compiled using Tkinter also needs to specify the -w parameter followed by the path. ,
There is a packaging process. After a while, an exe program will be generated in the pyinstaller directory.
The above is the detailed content of Does python come with a library for packaging exe?. For more information, please follow other related articles on the PHP Chinese website!