kindle manager
This commit is contained in:
43
打包MacBook指南.md
Normal file
43
打包MacBook指南.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# MacBook 打包 PySide6 应用指南
|
||||
|
||||
## 1. 安装 PyInstaller
|
||||
|
||||
```zsh
|
||||
pip install pyinstaller
|
||||
```
|
||||
|
||||
## 2. 打包命令(推荐单文件)
|
||||
|
||||
```zsh
|
||||
pyinstaller --noconfirm --windowed --onefile --icon=icons/Cbb20.png kmanapp.py
|
||||
```
|
||||
|
||||
- `--windowed`:无控制台窗口(GUI应用必选)
|
||||
- `--onefile`:生成单一可执行文件
|
||||
- `--icon=...`:指定应用图标
|
||||
|
||||
## 3. 资源文件处理
|
||||
如有图片、qrc、数据库等资源,需在 `kmanapp.spec` 的 `datas` 字段添加:
|
||||
|
||||
```python
|
||||
# 在 .spec 文件的 a = Analysis(...) 里 datas= 加入:
|
||||
('icons/Cbb20.png', 'icons'),
|
||||
('kmanapp.qrc', '.'),
|
||||
('kmanapp_rc.py', '.'),
|
||||
('vocab.db', '.'),
|
||||
# 其他资源...
|
||||
```
|
||||
|
||||
## 4. 重新打包
|
||||
|
||||
```zsh
|
||||
pyinstaller kmanapp.spec
|
||||
```
|
||||
|
||||
## 5. 运行
|
||||
|
||||
打包后在 `dist/` 目录下生成可执行文件,双击即可运行。
|
||||
|
||||
---
|
||||
|
||||
如需自动化脚本或遇到打包报错,请告知具体需求。
|
||||
Reference in New Issue
Block a user