1206 Python learning Pyinstaller library packaging
Need to install PyInstaller library
Installation method:
pip installer PyInstaller
Common methods:
method 1:
- Command prompt (CMD) input
cd: 需要打包的文件目录
Press Enter to enter - Then enter
pyinstaller -F 文件名.py
- When the word succful is displayed at the end of the command prompt window, it means the packaging is successful
- For the above packaging methods, the default packaging files are in the directory of the files to be packaged.
- In the current directory, dist file inside
文件名.py
is the success of the program package (can be run directly, you can copy it alone use)
Method 2:
- Command prompt (CMD) input
cd: 需要打包的文件目录
Press Enter to enter - Then enter
pyinstaller -F -w 文件名.py
(you need your own code to include GUI) - When the word succful is displayed at the end of the command prompt window, it means the packaging is successful
- For the above packaging methods, the default packaging files are in the directory of the files to be packaged.
- In the current directory, dist file inside
文件名.py
is the success of the program package (can be run directly, you can copy it alone use)