【发布时间】:2013-02-11 07:44:35
【问题描述】:
我正在使用 cx_freeze 来部署我的应用程序。我想包含整个目录,因为包含单个文件不会将它们放在文件夹中。如何包含文件夹?
【问题讨论】:
我正在使用 cx_freeze 来部署我的应用程序。我想包含整个目录,因为包含单个文件不会将它们放在文件夹中。如何包含文件夹?
【问题讨论】:
您必须为构建选项设置包含文件参数。您可以通过不同的方式执行此操作,但我将展示我的配置的一部分。我在这里描述的是一个特定的文件和一个特定的目的地。我想你也可以设置这样的路径,但我还没有测试过。
编辑:对此进行了测试,因此请为您的项目选择正确的方法。
buildOptions = dict(include_files = [(absolute_path_to_your_file,'final_filename')]) #single file, absolute path.
buildOptions = dict(include_files = ['your_folder/']) #folder,relative path. Use tuple like in the single file to set a absolute path.
setup(
name = "appname",
version = "1.0",
description = "description",
author = "your name",
options = dict(build_exe = buildOptions),
executables = executables)
也看看这个话题。它解决了同样的问题:How can i bundle other files when using cx_freeze?
【讨论】: