1.安裝依賴 lib
python3 ./setup.py
2.在script.py撰寫腳本
3.執行 GUI 程式gui.py
python3 ./gui.py
4.使用 pyinstaller 打包 EXE
在cmd環境下cd到檔案目錄
1.pyinstaller -D -w .\gui.py
-F 打包成一個exe文件
–icon=圖標路徑
-w 使用視窗,無控制台
-c 使用控制台,無視窗
-D 創建一個目錄,包含exe以及其他一些依賴性文件
--hidden-import module
2.如有已有.spec文件 可調整細部參數或手動import lib 資源
3.修改gui.spec內文
4.再次輸入 pyinstaller -D -w gui.spec