我有两个专门用于浏览和保存输出的内置按钮。它在控制台中工作正常。但是当我用它构建exe时,这两个按钮根本就不会打开资源管理器以便浏览或保存。 这是cx_freeze代码
import cx_Freeze
import sys
base = None
if sys.platform == 'win32':
base = "Win32GUI"
executables = [cx_Freeze.Executable("cypher.py", base=base,icon="icon2.ico")]
cx_Freeze.setup(
name = "Classical-Cypher",
options = {"build_exe": {"packages":["tkinter","PIL"], "include_files":["icon2.ico"]}},
version = "BETA",
description = "Encryption and decryption of classical cyphers",
executables = executables
)
建筑显示没有错误! GUI的图像是GUI
请帮忙。
答案 0 :(得分:0)
import tkinter
import tkinter.filedialog
在cx_Freeze脚本中,
options = {"build_exe": {"packages":["tkinter","PIL","tkinter.filedialog"], "include_files":["icon2.ico"]}},
完成! :)