Home > Mobile >  Python - attaching to project half way thru the execution
Python - attaching to project half way thru the execution

Time:10-15

Google'd but only getting results about how we can create launch.json configs and start the debugging from line #1.

So I have a [big?] Python project that runs from command-line, and I just created a helper method (def pauseHereAndNotifyUserOnSlack(user=<username>) to pause where needed and wait for the user to press a key to exit out of this [infinite] loop and resume the code.

I am wondering if there's a way to attach my python project while the code is paused, inspect the variables and stuff, and resume execution from there?

(Think C#/C has this feature, where they attach using symbols and stuff? Not 100% sure how this works. Maybe I am confusing myself?)

Let me know if you guys need more clarification. TIA

CodePudding user response:

You don't need to debug your code from line 1, set breakpoints in your code and start debugging from there and inspect variables and can also resume execution from there. (if this is what you were talking about) the play button can be used to resume your execution.example given below

CodePudding user response:

This is what I am looking for - https://www.youtube.com/watch?v=aZJnGOwzHtU&loop=0

  • Related