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.


    Pythonista debugger

    Pythonista
    3
    5
    3520
    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.
    • brianolive
      brianolive last edited by

      Could someone point me to documentation that explains how to use the Pythonista debugger, including the built-in breakpoint feature? Thanks!

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

        The Debugger section of http://omz-software.com/pythonista/docs/ios/new.html is all the docs I have seen.

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

          Thanks for the info - I hadn’t seen that.

          It seems I was trying to use it correctly, but I was setting a breakpoint in a custom view’s update method, and the debugger seems to ignore it. Is there something under the hood here that prevents the debugger from accessing this code?

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

            I don't think you can set a breakpoint inside a view callback, unless maybe if you wrap the callback in ui.in_background, though even then, since that code is called by a different thread, I'm not sure the main interpreter knows about it. I think once the main script "ends", the breakpoints don't do anything (like, if you call a function from the console, breakpoint do nothing)

            You may be able to import the pythonista debugger module (I forget the name... It is a subclass of bdb), then call set_trace from within your code. Also, I suspect if, from your main script, you call your callback yourself, then the breakpoint would work.

            The best way to debug view code, in my opinion is to run your view in 'panel' so you can switch back and forth between console and the view. You can also use pdb.set_trace to run pdb using the console in this way, but just make sure your callbacks are in the background in the case.

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

              Thank you!

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