I have a small timer script that displays information through a pygame window. I can run it fine as a script. When I convert it to an .exe with pyinstaller, it still runs fine, but when I exit by pressing the "x" at the top of the window, i get an error message "Failed to execute script myscript." I assume it is a problem with my closing code.
If it matters, I am running pyinstaller with options -F (make a single file) and -w (run without a console window)
I have added new parameters to the close code as suggested in other threads here. My current exit code is listed below.
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.display.quit()
pygame.quit()
exit()
I just want it to close cleanly without an error