首页 > 解决方案 > 我在 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_()

标签: pythonpyqtpyinstaller

解决方案


在创建 exe 时使用命令 --icon

<<cmd your path >>$pyinstaller --noconsole --icon "c:\icon.ico" pythoncode.py

推荐阅读