How to save on shutdown or KeyboardInterrupt #551
wheelercj
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I had a need to save to a file when my app closed no matter why it closed. The solution I found (with Textual 0.1.15 on Windows) was not what I first expected would work, so here it is in case it helps others.
The same seems to work with
close_all
instead ofshutdown
. Defining a__del__
method did not work for some reason, and any exceptions raised in the app will not make it out ofMyApp.run()
, so it seems a try-except block is not an option either.Hope this helps!
Beta Was this translation helpful? Give feedback.
All reactions