我在让cx-freeze制作我的可执行文件时遇到了麻烦,这会大量使用tkinter。我的安装文件代码如下:
import sys
from cx_Freeze import setup, Executable
build_exe_options = {"packages":["tkinter"]}
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "distthis",
version = "0.01",
description = "Report Generator",
options = {"build_exe": build_exe_options},
executables = [Executable("distthis.py", base=base)]
)当我尝试从命令行(在同一目录中)构建此程序时,我可以打开该程序,但它不会打开文件对话框。我想问题可能出在tkinter身上。有人能帮上忙吗?
发布于 2015-08-11 17:17:50
好吧,我在这里找到了答案:Keep getting a 'filedialog' error after creating executable with cx_Freeze
按照页面底部的建议,我将tkinter模块导入更改为显式导入,问题就解决了。
如果有人知道为什么会发生这种奇怪的行为,我很想知道!
https://stackoverflow.com/questions/31924138
复制相似问题