How to enter into imported package while debugging in VS code
As an example:
import os
import mdfreader
k123 = mdfreader.mdf("Test.mf4")
How to enter into the mdf function in the imported package
You can also start the debugger by clicking on the down-arrow next to the run button on the editor, and selecting Debug Python File in Terminal. The debugger will stop at the first line of the file breakpoint. The current line is indicated with a yellow arrow in the left margin.
Starting Python Debugger To start debugging within the program just insert import pdb, pdb. set_trace() commands. Run your script normally and execution will stop where we have introduced a breakpoint. So basically we are hard coding a breakpoint on a line below where we call set_trace().
By default, the debugger uses the same interpreter selected for your workspace, just like other features of Python extension for VS Code. To use a different interpreter for debugging specifically, set the value for python in launch.json for the applicable debugger configuration.
The simplest way to begin debugging a Python file is to use the Run view and click the Run and Debug button. When no configuration has been previously set, you will be presented with a list of debugging options. Select the appropriate option to quickly begin debugging your code.
You’ll be able to step into (F11) the 3rd party library and debug freely with source code and all other VS features available: Like with all other methods in this article, when using this, you need to disable the “Enable Just My Code” option and enable the “Suppress JIT optimization on module load” option.
There are many cases when there’s an exception in the 3rd-party code that you want to debug. Here are some examples: When something strange is going on and you can’t understand why. For example, a request to your server returns a 500 error code for no apparent reason.
In your launch.json
add the "justMyCode": false
setting. That will allow you to step into third-party code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With