Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Emulator/on device, how to get rid of debugging console after closing app?
-
So I've been having a ton of fun doing all my work in xcode now and running in the simulator, and just now I started sideloading onto my phone as well. It's great. I even figured out how to force landscape and hide the statusbar as well so I've been pretty happy!
The one thing is... I can't figure out any way to eliminate the console which appears after the app is closed. Currently I close my final scene with
mainview.close()
Which, again, quits the app but presents the debugging console. What are my options?
-
if you want to go back to the home screen, you
- buy the "launcher" app
- modify your script to
import webbrowser
- terminate your script with
webbrowser.open('launcher://crash')
-
Or you can just kill Python with
os.abort()
.But why do you have a way to close your app from within the app? When it's designed to run in Pythonista, that makes sense, because you need to be able to close it somehow. But if it's meant to be a standalone app, you already have a standard way of closing it - the home button. So you can simply take out whatever "exit" button you have and you don't need to worry about being unable to exit the app.
-
@ dgelessus
Good point, I was focused on solving the perceived problem and didn't even think about that. However, what would happen in the case of a hypothetical crash? Is there any way for it to ever "unintentionally" land on the debugging console?
-
An uncaught Exception could show the console... show just be sure to catch all exceptions, perhaps logging them instead.
-
It might be useful to write a top-level
except BaseException as exc
handler that logs the exception, and then crash on purpose withos.abort()
. That's probably more user-friendly than showing the debug console with a traceback, or silently logging the exception and pretending that nothing happened.