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
  simple if fail, what am I missing? ajkrueger25 2 746 Nov-13-2024, 04:21 AM
Last Post: ajkrueger25
  keeping logs for every success fail attempt robertkwild 22 5,388 Jul-19-2024, 03:49 PM
Last Post: robertkwild
  python difference between sys.exit and exit() mg24 1 3,900 Nov-12-2022, 01:37 PM
Last Post: deanhystad
  How to calculated how many fail in each site(s) in csv files SamLiu 4 2,286 Sep-26-2022, 06:28 AM
Last Post: SamLiu
Heart Yahoo email "search and destroy"! Linh_lee 20 8,969 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 3,449 Mar-11-2022, 01:50 PM
Last Post: snippsat
  [SOLVED] Why does regex fail cleaning line? Winfried 5 3,484 Aug-22-2021, 06:59 PM
Last Post: Winfried
  scraping video src fail jacklee26 5 4,794 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,988 Apr-08-2019, 10:05 AM
Last Post: avinash
  fail to upgrade pygobject jiapei100 0 3,619 Aug-16-2018, 10:32 AM
Last Post: jiapei100

Forum Jump:

User Panel Messages

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