通过 pyinstaller 时程序不是 运行
Program not running when put through pyinstaller
我在使用 exit
时遇到了 pyinstaller 问题,出现错误,程序无法 运行。当我使用 quit
或 sys.exit()
时,程序不会 运行。如果我将所有这些都排除在外并使用 X 按钮,线程将在任务管理器中保持 运行ning。我应该使用什么功能来解决这个问题?
需要代码
def exitgame():
sys.exit()
main = Tk()
main.title("Fruit Clicker")
main.geometry("400x350+300+100")
Button(main, text="Play", command=rootopen).pack()
Button(main, text="Quit Game", command=exitgame).pack()
提前致谢
无需编写退出应用程序的函数,无需函数即可直接关闭应用程序,只需将“command=exitgame”替换为“command=main.destroy”即可 'Quit game button'.
示例代码-
from tkinter import *
from tkinter.ttk import *
main = Tk()
main.title("Fruit Clicker")
main.geometry("400x350+300+100")
Button(main, text="Quit Game", command=main.destroy).pack()
mainloop()
我在使用 exit
时遇到了 pyinstaller 问题,出现错误,程序无法 运行。当我使用 quit
或 sys.exit()
时,程序不会 运行。如果我将所有这些都排除在外并使用 X 按钮,线程将在任务管理器中保持 运行ning。我应该使用什么功能来解决这个问题?
需要代码
def exitgame():
sys.exit()
main = Tk()
main.title("Fruit Clicker")
main.geometry("400x350+300+100")
Button(main, text="Play", command=rootopen).pack()
Button(main, text="Quit Game", command=exitgame).pack()
提前致谢
无需编写退出应用程序的函数,无需函数即可直接关闭应用程序,只需将“command=exitgame”替换为“command=main.destroy”即可 'Quit game button'.
示例代码-
from tkinter import *
from tkinter.ttk import *
main = Tk()
main.title("Fruit Clicker")
main.geometry("400x350+300+100")
Button(main, text="Quit Game", command=main.destroy).pack()
mainloop()