How to Debug Python with VSCode

preview_player
Показать описание
In this short tutorial I want to show you how to debug Python scripts with VSCode. I explain simple and conditional breakpoints, and how to log messages instead of using print statements (poor man's debugger).

See my social profiles here

Рекомендации по теме
Комментарии
Автор

I'm a poor man. When I have a bug, I type "print".

scarletdcruz
Автор

If "click the debug button" worked in the first place, I wouldn't have searched for this video.

selylidne
Автор

`expression`/`hit count` as well as the log message is awesome! Thanks for sharing!

vcfvct
Автор

Thankyou for making this so clear and easy to follow.

OllytheOzzy
Автор

Sir, you have constructed an excellent and targeted concise tutorial on debugging Python with VSCode; *thank you!* - new Subscriber here.

billwindsor
Автор

This has been very helpful, buddy. Thanks a lot :D

LeirbagIII
Автор

thanks for the explanations - very useful :D

zenmaster
Автор

great work! -(a professional poor man)

bahaz.
Автор

Is there a way in which you can change your code and then move the arrow up as you do in the VBA Excel debugging?

luigineri
Автор

Great video. Can I ask what the font and color theme are?

flagman
Автор

my problems are appearing in the call stack when debugging, instead of in the problems menu. And I dont know how to fix this

ruarkpotgieter
Автор

How do I change the current line? Is not possible dragging and drop the cursor?

marcelogrsp
Автор

do you have to always write a little case that is calling your code to use the debugger?

susulemons
Автор

Hi Jay, useful video. Tell me please, I followed your instructions, a dded a log message on the breakpoint, replace the statement in do_something by "pass" when I hit F5 program breaks on the breakpoint when I hit run nothing is printed to the debig console, any idea what might be missing? Thanks for your help

eliassal
Автор

Thanks for your interesting video.
Perhaps you can help me cause I don't know how I can debug something like
"cat myfile | python-script-1.py option1 | python-script-2.py option2"?
I tried to use debugpy too. But I have to call both scripts like so
"python -m debugpy --listen 5678 --wait-for-client python-script-1.py option1"
and I don't know what to do if I want to debug both scripts at once. Perhaps there is a way to bring vs code into listen mode and connect to it from the cmdline scripts? This is the way I was used to work with when remote debugging PHP with xdebug.

uwegenosdude
Автор

Does anybody know how to control the debug console output? I'd like to see *only* my program printouts, not anything else - not even the command line! I just want a clean view of my outputs. Thanks!

gilmoses
Автор

Will this display contents of a dictionary like Xcode/AndroidStudio?

MrBecker
Автор

hi, can you tell me why in vs code when given to debug a pop up came up with "python path in debug configuration is invalid "

christinajohn
Автор

can I do reverse check after doing a single check?

md.wasiffaisal
Автор

Was hoping this would solve my issue but it doesn't. I have python code embedded in typescript code, and none of the breakpoints work in the py file.

michaelocchipinti