这是我第一次使用cx_freeze,我真的需要帮助,我一直在寻找,但我找不到答案。
我在编译过程中没有任何错误,但可执行文件没有做任何事情。有人可以解释一下为什么吗?
这是我的项目结构:
应用
我不知道在安装程序中包含文件cell.py的位置,现在它位于文件模块中。而且我不确定Tkinter是否应该包括或排除。
这是文件setup.py:
import sys
from cx_Freeze import setup, Executable
executables = [
Executable("application.py")
]
buildOptions = dict(
compressed = True,
includes = ["sys","re","PIL","ttk","xlrd","xlutils","datetime","string","Tkinter"],
include_files = ["responsible.xls","favicon.ico","logo.jpg"],
excludes = []
path = sys.path + ["modules"]
)
setup(
name = "test",
version = "1.1.1.0",
description = "test",
options = dict(build_exe = buildOptions),
executables = executables
)
答案 0 :(得分:0)
使用include_files选项添加要包含的目录。 所以这部分代码应该是这样的:
buildOptions = dict(
compressed = True,
includes = ["sys","re","PIL","ttk","xlrd","xlutils","datetime","string","Tkinter"],
include_files = ["responsible.xls","favicon.ico","logo.jpg", "modules"],
excludes = []
path = sys.path + ["modules"]
)