Python Forum
Why does [root.destroy, exit()]) fail after pyinstaller? Rpi
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why does [root.destroy, exit()]) fail after pyinstaller? Rpi
#1
I have a small GUI app with a close button that works as expected when the app is run in Thonny, but the Exit button code fails in the binary file created with pyinstaller. Since the GUI is full screen, I must do a forced reboot to exit as the GUI is full screen.

btn = tk.Button(root, text='Exit', font=(None, 14, 'bold'), command=lambda: [root.destroy, exit()])
Any advice appreciated.
Reply
#2
Why do you exit()? Destroying the root window will stop mainloop(). There should be nothing else going one after mainloop().
Reply
#3
(Oct-18-2023, 01:45 PM)deanhystad Wrote: Why do you exit()? Destroying the root window will stop mainloop(). There should be nothing else going one after mainloop().

Thanks Dean,
So the Exit() would cause this?

I'll be back to my desk in a few hours to test it.
Reply
#4
No idea. I don't use thonny, so I don't know how much it may alter the behavior of a Python program. If you use IDLE to write tkinter applications I'd say the way the program ran in IDLE is "somewhat representative" of how it runs in Python. How does your program work when you run it in python from the command line?
Reply
#5
Removing the exit() solved it.
When run from terminal, there were indications that exit() was not found or invalid.
Thanks.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  python difference between sys.exit and exit() mg24 1 1,852 Nov-12-2022, 01:37 PM
Last Post: deanhystad
  How to calculated how many fail in each site(s) in csv files SamLiu 4 1,307 Sep-26-2022, 06:28 AM
Last Post: SamLiu
Heart Yahoo email "search and destroy"! Linh_lee 20 4,287 Aug-28-2022, 10:57 AM
Last Post: sandrahdes
  Imports that work with Python 3.8 fail with 3.9 and 3.10 4slam 1 2,600 Mar-11-2022, 01:50 PM
Last Post: snippsat
  [SOLVED] Why does regex fail cleaning line? Winfried 5 2,470 Aug-22-2021, 06:59 PM
Last Post: Winfried
  scraping video src fail jacklee26 5 3,536 Jul-11-2021, 09:38 AM
Last Post: snippsat
  unable to pass a input after changing the user from root to non root using python avinash 3 3,206 Apr-08-2019, 10:05 AM
Last Post: avinash
  fail to upgrade pygobject jiapei100 0 3,083 Aug-16-2018, 10:32 AM
Last Post: jiapei100
  Fail to allocate bitmap rsbeesh 7 15,724 Dec-13-2017, 01:36 PM
Last Post: wavic
  how to destroy or remove object rendered with opengl from the screen? hsunteik 1 7,063 Apr-09-2017, 01:30 PM
Last Post: hsunteik

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020