编辑
以下是我的GUI代码:
from tkinter import *
import builtins as bi
root = Tk()
root.title("hello worlds")
btn = Button(root, text="hello worlds", command=bi.exit)
btn.pack()
root.mainloop()
这就是setup.py
import cx_Freeze as cf
import sys
executable = [cf.Executable("asd.py")]
cf.setup(
name = "asd",
executables = executable,
options = {"build_exe" : {"packages" : ["tkinter"]}}
)
当我构建脚本时,它工作正常,但当我运行可执行文件时,它会显示一个错误:
AttributeError: module 'builtins' has no attribute 'exit'
此外,我不能使用其他内置函数,我已尝试重新定义退出函数。但它也显示了一个错误:
RecursionError: maximum recursion depth exceeded
我如何解决这个问题
目前没有回答
相关问题 更多 >
编程相关推荐