1. 程式人生 > 實用技巧 >033 模組4-PyInstaller庫的使用

033 模組4-PyInstaller庫的使用

目錄

一、PyInstaller庫基本介紹

1.1 PyInstaller庫概述

將.py原始碼轉換成無需原始碼的可執行檔案

PyInstaller庫是第三方庫

1.2 pip的使用

pip的使用:https://www.cnblogs.com/nickchen121/p/11142580.html

1.3 pip install pyinstaller (cmd命令列)

pip install pyinstaller

二、PyInstaller庫使用說明

2.1 簡單的使用

(cmd命令列) pyinstaller -F <檔名.py>

2.2 PyInstaller庫常用引數

引數描述
-h 檢視幫助
--clean 清理打包過程中的臨時檔案
-D,--onedir 預設值,生成sist資料夾
-F,--onefile 在dist資料夾中只生成獨立的打包檔案
-i <圖示檔名.ico> 指定打包程式使用的圖示(icon)檔案

2.3 使用舉例

pyinstaller –i curve.ico –F SevenDigitsDrawV2.py