Pyinstaller, NameError: Global Name 'quit' Is Not Defined
I have a python script which runs just fine, however after running pyinstaller, I get the following when I use a quit() or exit() command: Makespec file: # -*- mode: python -*- a =
Solution 1:
That is because there is no quit
command. You are looking for sys.exit
.
Solution 2:
quit
can be found in pygame.locals import *
Usage:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
Solution 3:
def quit():
sys.exit()
self.quit_button = Button(self, text="QUIT",command = quit)
Post a Comment for "Pyinstaller, NameError: Global Name 'quit' Is Not Defined"