【发布时间】:2015-12-18 15:04:58
【问题描述】:
我创建了一个应用程序并为其添加了一个图标。当我通过 Visual Studio 运行我的应用程序时,图标应该会显示在左上角。但是,一旦我使用 cx_freeze 构建应用程序,该图标就会在 exe 文件上可见,但是一旦我执行它,该图标就不会出现在任务栏上或应用程序的左上角。
这是我的 setup.py
from cx_Freeze import setup, Executable
exe=Executable(
script="PythonMusicDownloader.py",
base="Win32Gui",
icon="resources/icon.ico"
)
includefiles=["controllers.py","models.py","views.py"]
includes=[]
excludes=[]
packages=["requests", "atexit", "Pyside"]
setup(
version = "0.1",
description = "Beta release of Music Downloader written in Python",
author = "Unknown",
name = "Music Downloader",
options = {'build_exe'{'excludes':excludes,'packages':packages,'include_files':includefiles}},
executables = [exe]
)
它是以下项目的一部分: https://github.com/Feverfew/PythonMusicDownloader
有谁知道我如何在构建图标后显示它?我在网上查过,但没有看到有人问我这样的问题。
【问题讨论】:
-
这个和这个的可能重复。作为一个有用的提示,尝试使用 png 或 gif 图标,或尝试 PyInstaller。我以前也遇到过类似的问题。 stackoverflow.com/questions/3499902/…stackoverflow.com/questions/5721953/…