我的cx\u Freeze Python应用程序只适用于cons

2024-06-16 10:59:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我创建了一个reddit刮板将下载图片从reddit和改变我的墙纸。它的工作方式我希望它没有任何问题。我使用cx\u Freeze为应用程序创建了一个可执行文件,其setup.py如下

from cx_Freeze import setup, Executable

base = "Win32GUI" # Without Console
# base = None ## With Console
includefiles = ["WallpaperUpdater.ico", "templates/"]

executables = Executable(
    script="WallpaperUpdater.py",
    base=base,
    icon="WallpaperUpdater.ico"
)

packages = ["idna", "requests", "multiprocessing"]
options = {
    "build_exe":
    {
        "packages": packages,
        "include_files": includefiles
    },
}

setup(
    name="Wallpaper Updater",
    options=options,
    version="0.1",
    description="Downloads top images form subreddits and change wallpaper",
    executables=[executables]
)

除库存模块外的其他模块- 1) 婴儿车 2) PyQt5型 3) 时间表

这个问题是当我尝试在没有控制台的情况下构建它时,它无法工作。我认为它不会向套接字发送消息来检索刷新令牌但是当我用控制台构建它时,这是有效的

如果有任何帮助,我将不胜感激。 谢谢你


Tags: 模块pybasepackagessetupconsoleoptionscx