我怎样才能使用 cx_freeze 包含一个文件夹?
- 2024-12-27 08:46:00
- admin 原创
- 140
问题描述:
我正在使用 cx_freeze 部署我的应用程序。我想包含整个目录,因为包含单个文件不会将它们放在文件夹中。我该如何包含文件夹?
解决方案 1:
您必须为构建选项设置一个包含文件参数。您可以通过不同的方式执行此操作,但我将展示我的部分配置。我在这里描述的内容是针对一个特定文件和一个特定目标。我认为您也可以像这样设置路径,但我还没有测试过。
编辑:已测试过,因此请为您的项目选择正确的方法。
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)
也看看这个主题。它大概解决了同样的问题:使用 cx_freeze 时如何捆绑其他文件?
相关推荐
热门文章
项目管理软件有哪些?
热门标签
云禅道AD