1. 程式人生 > >最簡單最適用python 打包成exe

最簡單最適用python 打包成exe

第一步:下載PyInstaller

https://github.com/pyinstaller/pyinstaller 

方法二:下載原始碼安裝

在github中打包下載,解壓到電腦中,執行命令列進入此目錄。

//進入子目錄 bootloader
cd bootloader

//build the bootloader 執行
python ./waf configure build install

//重新進入根目錄
cd ..

//安裝pyinstaller
python setup.py install

第三步:檢視安裝結果,執行命令:

pyinstaller --version

這裡寫圖片描述

說明安裝成功。

第四步:簡單的編譯,執行程式碼:

a)簡單編譯會產生很多包
pyinstaller D:\xxx\xx\hello.py

b)只產生一個exe檔案
pyinstaller -F D:\xxx\xx\hello.py

c)直接釋出的exe應用帶命令列除錯視窗,在指令內加入-w命令可以遮蔽
pyinstaller -w D:\xxx\xx\hello.py