【问题标题】:In cx_freeze setup function, what do the name, version, and description keywords actually do?在 cx_freeze 设置函数中,name、version 和 description 关键字实际上是做什么的?
【发布时间】:2020-10-16 08:21:50
【问题描述】:

当我使用 cx_freeze 冻结我的代码时,我通常在 setup 函数中包含名称、版本和描述关键字参数,因为这是文档示例中所做的。但我无法弄清楚这些关键字参数实际上如何影响安装脚本的输出。如果我忽略或省略这些关键字参数,是否会导致任何问题?以下是参考文档中的示例代码。

import sys
from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]}

# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(  name = "guifoo",
        version = "0.1",
        description = "My GUI application!",
        options = {"build_exe": build_exe_options},
        executables = [Executable("guifoo.py", base=base)])

【问题讨论】:

标签: python setuptools cx-freeze distutils


【解决方案1】:

嘿亲爱的名字是输出.exe(应用程序)的名称,描述是您制作的应用程序的描述,描述将在任务管理器中显示为任务(应用程序)的名称和最后版本是您的应用程序的版本.. 谢谢

【讨论】:

  • 谢谢。我确实在任务管理器中看到了描述。但是 name 参数似乎不会影响 .exe 文件的名称。如果我的脚本名为 hello.py,并且我将“再见”传递给 setup 函数的 name 参数,则生成的 .exe 仍称为 hello.exe。我确实发现 Executable 类有一个名为 targetName 的参数,它将重命名 .exe 文件。自从最初提出这个问题以来,我还发现当我尝试为我的脚本制作安装程序(cx-freeze 中的 bdist_msi 命令)时,setup 函数中的 name 参数确实发挥了作用
猜你喜欢
  • 2019-08-21
  • 2013-12-23
  • 1970-01-01
  • 2010-12-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-09-22
  • 1970-01-01
相关资源
最近更新 更多