omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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?

    Pythonista
    4
    6
    3667
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • WTFruit
      WTFruit last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • cvp
        cvp last edited by cvp

        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')
        
        1 Reply Last reply Reply Quote 0
        • dgelessus
          dgelessus last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • WTFruit
            WTFruit last edited by

            @ 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?

            1 Reply Last reply Reply Quote 0
            • JonB
              JonB last edited by

              An uncaught Exception could show the console... show just be sure to catch all exceptions, perhaps logging them instead.

              1 Reply Last reply Reply Quote 1
              • dgelessus
                dgelessus last edited by

                It might be useful to write a top-level except BaseException as exc handler that logs the exception, and then crash on purpose with os.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.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB Forums | Contributors