python - 我在 pyqt 中创建了一个应用程序,它有图标。我正在使用 pyinstaller 使其成为 exe 我如何在 Exe 中添加图标
问题描述
import sys
from PyQt5.QtWidgets import QApplication, QWidget
app = QApplication(sys.argv)
window = QWidget()
window.show() # IMPORTANT!!!!! Windows are hidden by default.
# Start the event loop.
app.exec_()
解决方案
在创建 exe 时使用命令 --icon
<<cmd your path >>$pyinstaller --noconsole --icon "c:\icon.ico" pythoncode.py
推荐阅读
- python-3.x - Modulenotefounderror; 没有模块名称 cplex
- javascript - 如何在 JavaScript 中获取浏览器复制图像的实际 URL
- android - Android R8 片段实现但实际上匹配扩展
- python - 如何遍历嵌套字典中的一系列给定键
- c# - 使用 Automapper 保存递归结构时违反 PRIMARY KEY 约束
- matlab - 我为数学公式编写了一个函数,请问您检查我的代码吗?
- excel - 循环不进一步
- macos - LLDB 和库函数的内存地址
- javascript - 粘贴前替换剪贴板中的特殊字符
- mysql - docker-compose up 后,MySQL 容器在“X 插件准备好连接”处停止