Everything You Need to Know about Debugging in VSCode

  Рет қаралды 23,142

ArjanCodes

ArjanCodes

Күн бұрын

This video is a quick guide to debugging Python scripts in VSCode. I’ll cover the basics of the VSCode debugger and show you how to use it to fix your code easily.
👷 Join the FREE Code Diagnosis Workshop to help you review code more effectively using my 3-Factor Diagnosis Framework: www.arjancodes.com/diagnosis.
💻 ArjanCodes Blog: www.arjancodes.com/blog
✍🏻 Take a quiz on this topic: www.learntail.com/quiz/xjfodd
Try Learntail for FREE ➡️ www.learntail.com/
🎓 Courses:
The Software Designer Mindset: www.arjancodes.com/mindset
The Software Architect Mindset: Pre-register now! www.arjancodes.com/architect
Next Level Python: Become a Python Expert: www.arjancodes.com/next-level...
The 30-Day Design Challenge: www.arjancodes.com/30ddc
🛒 GEAR & RECOMMENDED BOOKS: kit.co/arjancodes.
👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!
Social channels:
💬 Discord: discord.arjan.codes
🐦Twitter: / arjancodes
🌍LinkedIn: / arjancodes
🕵Facebook: / arjancodes
📱Instagram: / arjancodes
♪ Tiktok: / arjancodes
👀 Code reviewers:
- Yoriz
- Ryan Laursen
- Dale Hagglund
- Kit Hygh
- Alexander Milden
- Bean
🎥 Video edited by Mark Bacskai: / bacskaimark
🔖 Chapters:
0:00 Intro
0:27 Setup
1:43 Breakpoints
3:53 Call stack
4:13 Variables
5:55 Watch
6:44 Outro
#arjancodes #softwaredesign #python
DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!

Пікірлер: 95
@ArjanCodes
@ArjanCodes Ай бұрын
👷 Join the FREE Code Diagnosis Workshop to help you review code more effectively using my 3-Factor Diagnosis Framework: www.arjancodes.com/diagnosis.
@cstephens16
@cstephens16 Ай бұрын
A whole series on debugging would be awesome. Seriously.
@eduardolpz386
@eduardolpz386 Ай бұрын
This is great. A debug FastAPI video would be great too. Thank you for all your work.
@leowalker07
@leowalker07 Ай бұрын
adding a vote for debug FastAPI with vscode
@angeatgr
@angeatgr Ай бұрын
there is nothing different when debugging FastAPI or Django app, even Flutter app for that matter. But VSCode will help you create the debugging setup.
@ShanilPanara
@ShanilPanara Ай бұрын
I've coded with VSCode for years now but never known how to use the debugger! Looks really powerful and I guess it forces you to code a little more carefully as well Gonna try to incorporate it in my dev workflow soon and see what difference it makes! Thanks Arjan
@LiquidMasti
@LiquidMasti Ай бұрын
Same I have been using vscode for years but never used debugger only used print statement or took my code to .ipynb to solve
@wexwexexort
@wexwexexort Ай бұрын
I would love to see a debugging video for FastAPI and another video similar to this one but for pycharm.
@dilliboy3366
@dilliboy3366 Ай бұрын
This is one of the most beautiful videos I have ever watched on debugging.
@ArjanCodes
@ArjanCodes Ай бұрын
I'm glad it was helpful!
@kreglfromworld
@kreglfromworld Ай бұрын
One thing missing that I find myself using a lot is the debugger console. Any time I'm unsure of how exactly to do something I use a breakpoint, run my ideas at that point through the debugger console to see what works, and implement it in code.
@DagarCoH
@DagarCoH Ай бұрын
Did not know about the conditional break points. That is so useful!
@michael_baron
@michael_baron Ай бұрын
Same. For years I had no idea. :D
@ArjanCodes
@ArjanCodes Ай бұрын
Glad the video was helpful!
@Iamsuperb4
@Iamsuperb4 Ай бұрын
I'll definitely be using those from now on! Better than adding a temporary if statement and putting a breakpoint inside it 😂
@mahamadinikiema9860
@mahamadinikiema9860 Ай бұрын
Great work. A whole series of best practices for debugging with VSCode would be great. Thanks.
@apsomething
@apsomething Ай бұрын
Would be great to see more advanced video about debugging!
@chaseadal
@chaseadal Ай бұрын
Fastapi debugging! Yes please! Fastapi with docker would be great too.
@thefanboy3285
@thefanboy3285 Ай бұрын
Learning with you makes my brain tingles. It's like ASMR but with knowledge instead of sensitive stimuli.
@ArjanCodes
@ArjanCodes Ай бұрын
That's a really original way to put it! I appreciate the compliment :)
@thefanboy3285
@thefanboy3285 Ай бұрын
@@ArjanCodes you're welcome. And btw, how do I pronunce the "Arjan" ? Arian ? Arj' an ?
@Chaplainelmo2001
@Chaplainelmo2001 Ай бұрын
Great ... enabled me to add several new tips to my own hard learned uses so far. VS Code formerly had a great "Preview" extension that visualized the call stack and allowed stepwise execution and display of function calls, returns, etc. I found that to also be a great assist in debugging as well.
@user-pq9hh7yz1d
@user-pq9hh7yz1d Ай бұрын
Yes, we need separate video about debugging a FastAPI application
@meqdaddev4341
@meqdaddev4341 Ай бұрын
Thanks for the precise and high quality content. Keep coding dear Arjan.
@ArjanCodes
@ArjanCodes Ай бұрын
Thank you for the kind words!
@mitchedmunds
@mitchedmunds 22 күн бұрын
Great video! I think that it would have been useful to cover the debug console and also VS Code's testing pane where you can collect tests and then debug individual tests. It may have also been worth mentioning that you can Debug cells in the built-in Jupyter notebooks too - but these would be good topics for a follow up!
@Piipolinoo
@Piipolinoo Ай бұрын
Concise and straight to the point. That was an excellent video, thank you!
@ArjanCodes
@ArjanCodes Ай бұрын
Glad you enjoyed the content!
@Doppelwulf
@Doppelwulf Ай бұрын
I had no idea there were options for breakpoints. The conditional breakpoint is a big win for me, thanks!
@ArjanCodes
@ArjanCodes Ай бұрын
Glad the video was helpful!
@eziola
@eziola Ай бұрын
Thanks for these basic videos. Extremely helpful
@ArjanCodes
@ArjanCodes Ай бұрын
Glad you like them!
@simeidoblinski
@simeidoblinski Ай бұрын
Thank you very much! A video expanding on debugging a FastAPI application would be great!
@PouriyaJamshidi
@PouriyaJamshidi Ай бұрын
Great video This is a topic that is almost never taught
@ArjanCodes
@ArjanCodes Ай бұрын
Glad you liked it!
@ivanchan7769
@ivanchan7769 Ай бұрын
A debug FastAPI video would be great. Thank you for all your work.
@rangabharath4253
@rangabharath4253 Ай бұрын
Awesome as always and very useful. Thanks 🙂
@ArjanCodes
@ArjanCodes Ай бұрын
Glad you liked it!
@SiegfriedHirsch
@SiegfriedHirsch Ай бұрын
Nice help. FastAPI debugging would be great
@marcelhulsberg501
@marcelhulsberg501 Ай бұрын
great video! I also frequently use the tebugging terminal (Ctrl+Shift+Y), where you can calculate expressions (similar to the watch section), but can also create and manipulate variables etc. the debugger also works great with pytest
@gerardovelazquez9294
@gerardovelazquez9294 Ай бұрын
Debugging python code inside docker from vscode will be great!
@justchary
@justchary Ай бұрын
Thank you. I learned something
@ArjanCodes
@ArjanCodes Ай бұрын
Glad it was helpful!
@CharleswoodSpudzyofficial
@CharleswoodSpudzyofficial Ай бұрын
I love you Arjan!
@robosergTV
@robosergTV Ай бұрын
yes, please do a video about debugging FastAPI!
@virtualraider
@virtualraider Ай бұрын
debugging a Flask application would also be incredibly useful. A problem with most KZbin debugging videos is that they show how to work on simple scripts, but debugging an app running on a framework is way more complicated 😅
@user-kv7pi8fw6p
@user-kv7pi8fw6p Ай бұрын
I would love to see a debugging video for FastAPI
@diegol_116
@diegol_116 Ай бұрын
Ok I thought I knew everything related to Debug in VSCode...but it turned out I didn't...
@claberone
@claberone Ай бұрын
It would be really interesting to have a video on Fastapi and SQLModel as an ORM.
@abdelghafourfid8216
@abdelghafourfid8216 Ай бұрын
debuging FastApi or streamlit applications would be interesting
@sany2k8
@sany2k8 Ай бұрын
Great content as always ❤, can you please add a debugging video with VSCode and FastAPI?
@LunaSicilian
@LunaSicilian Ай бұрын
I hope you talk about more request type in launch.json (attach, launch, remote debugging,....) and some advance topic like debug threading, asyncio debug, .... What you sharing in the video is simple, or just for beginer.
@witcherek
@witcherek Ай бұрын
Yes, debugging fastapi and other framework will be super cool, please do it ;)
@wizardfix
@wizardfix Ай бұрын
Thanks for this! But what I have never managed to get working is debugging code running in a container (using Docker/Podman etc.). A demonstration of the setup for this would be very much appreciated (assuming you can figure it out!).
@erikvanraalte4557
@erikvanraalte4557 Ай бұрын
How did you get the Python Debug Console in the editor pane? I love to open terminals in the editor area, but I haven't managed this for the Debug Console.
@franco-gil
@franco-gil Ай бұрын
More debug! On VSCode 👋
@AlanBerman
@AlanBerman Ай бұрын
Please do a series on debugging
@Brunojavaa
@Brunojavaa Ай бұрын
Very good, how to debug in vscode when i run in docker?
@niweshsah5337
@niweshsah5337 11 күн бұрын
Make a whole series on debubbiging Please
@joshbleijenberg4000
@joshbleijenberg4000 5 күн бұрын
Nice video, can you create a video on how to debug Django Rest Framework?
@PaulaBean
@PaulaBean Ай бұрын
I'd like to use VSCode to attach to (and debug) running web services, written in python, which run in a container (docker or kubernetes) in the cloud somewhere (azure, aws), but it is unclear to me how to go about that.
@kaelinellis1646
@kaelinellis1646 Ай бұрын
How can I debug a file that I have to run from the command line? If it has imports from another folder, so I need to start it above the file directory.
@CalmlyExplained
@CalmlyExplained Ай бұрын
You can run debugger in module mode. You define your settings via json file.
@anibalismaelfermandois6943
@anibalismaelfermandois6943 Ай бұрын
We want the fast API one!!!
@anibalismaelfermandois6943
@anibalismaelfermandois6943 Ай бұрын
I work with fast API along side docker compose. Any recommendations for debbuging and testing? I'm a bit overwhelmed with the amount of options.
@LMGaming0
@LMGaming0 Ай бұрын
Why using debugging for module instead of normal file? is there really a big advantages? and can we have a video with 3-4 different debuggers and when/why to use?
@legion_prex3650
@legion_prex3650 Ай бұрын
hmmm, what is this star icon in line 8? right before return average_score? Is this some fancy icon for a breakpoint?
@mitchedmunds
@mitchedmunds 22 күн бұрын
I have a feeling it's something to do with Copilot, like a suggestion feature or something. I don't think it's relevant to the topic so I wouldn't worry for now.
@fabrelambeau5858
@fabrelambeau5858 Ай бұрын
An idea for another video would be how to perform refactoring with VSCode. I used to use IntelliJ, and it seemed to offer quite a bit more. Maybe I haven’t yet found the right way in VSCode…
@mohamedsalman4013
@mohamedsalman4013 Ай бұрын
Hey, It would be very helpful, If you make a video for Pycharm (FastAPI project)
@Blackrobe
@Blackrobe Ай бұрын
I worked closely with Spark scripts, so I'm kinda sad that VSCode features like breakpoints and such can't really be used for example checking dataframes...
@AntonsWorkshop
@AntonsWorkshop 29 күн бұрын
Can you include a video about debugging modules?
@fabrelambeau5858
@fabrelambeau5858 Ай бұрын
I found this one to be a little basic… is that all there is to debugging in VSCode? I’d be interested in knowing more advanced techniques.
@shubhamsinghal4725
@shubhamsinghal4725 Ай бұрын
Yes I'd like to watch FastAPI Debugging
@_baco
@_baco Ай бұрын
Debugging videos for FastAPI and Django, please!!!
@danielschmider5069
@danielschmider5069 Ай бұрын
Please make a video about debugging inside a docker container, it's seriously hard to find a good tutorial on it
@greob
@greob Ай бұрын
I’m still looking for an alternative to VSCode with a decent debugger… can’t figure out how to debug efficiently in vim or emacs. UwU
@lucianogarbarino5240
@lucianogarbarino5240 Ай бұрын
Please I would love to know how to debug a FastAPI app.
@williamalarcon7994
@williamalarcon7994 Ай бұрын
Hi, great video, could you make one showing how to debug apps made with poetry?
@GOTHICforLIFE1
@GOTHICforLIFE1 Ай бұрын
i agree - i have major issues pointing to the python interpreter since its not in the same dir as the code base
@mitchedmunds
@mitchedmunds 22 күн бұрын
Should be fairly simple as long as you've set the Python interpreter to the one in the virtual environment that poetry has created. There is a setting in VS code called "Venv Folders" which you can set to wherever poetry is creating your virtual environments. Or you can change the poetry setting "virtualenvs.in-project=true" which will create a .venv in your project folder and VS Code will find it more easily when trying to select an interpreter.
@adhd_arti
@adhd_arti Ай бұрын
I'm letting you know, I'd like to watch your video about FastAPI debuging
@trupalcanada
@trupalcanada Ай бұрын
til about conditional breakpoint it should be quite useful
@jancicruz7
@jancicruz7 Ай бұрын
Should have showed what the launch.json file does. It's a requirement in many professional environments to debug with that prepared.
@GuglielmoCerri
@GuglielmoCerri Ай бұрын
Would be very useful a whole series on Django
@danleedev
@danleedev Ай бұрын
Flask, please.
@stevendecoeyer1987
@stevendecoeyer1987 Ай бұрын
Every time I wonder so I just have to ask: what color iMac is that? 😂
@sprintwithcarlos
@sprintwithcarlos Ай бұрын
f5
@quillaja
@quillaja Ай бұрын
There's a bug in your data. No way Austen is rated lower than Orwell.
@brettvitaz9101
@brettvitaz9101 Ай бұрын
“Everything you need to know” “These are the very basics” 😅
@AyahuascaDataScientist
@AyahuascaDataScientist Ай бұрын
It took all these years for him to make this video??? It should’ve been a day 1 topic.
@younesveisi
@younesveisi Ай бұрын
Hi Arjan. Please Create a Video for debugging in Flask App. It's very important for me and my work as a Back-end developer with Flask. Thank you very much for all of you Videos.
Should You Use Dependency Injection Frameworks?
14:43
ArjanCodes
Рет қаралды 40 М.
Introduction to AVL Trees
11:36
BC Ko
Рет қаралды 23
Climbing to 18M Subscribers 🎉
00:32
Matt Larose
Рет қаралды 14 МЛН
They RUINED Everything! 😢
00:31
Carter Sharer
Рет қаралды 22 МЛН
The Worlds Most Powerfull Batteries !
00:48
Woody & Kleiny
Рет қаралды 27 МЛН
How to Document Your Code Like a Pro
19:03
ArjanCodes
Рет қаралды 80 М.
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 362 М.
30 VSCode Keyboard Shortcuts You NEED to Know
17:15
ArjanCodes
Рет қаралды 60 М.
Are you debugging JavaScript in VSCode? | YOU SHOULD!
7:06
Alex Ziskind
Рет қаралды 148 М.
Python's 5 Worst Features
19:44
Indently
Рет қаралды 84 М.
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 790 М.
Functions vs Classes: When to Use Which and Why?
10:49
ArjanCodes
Рет қаралды 140 М.
Protocols vs ABCs in Python - When to Use Which One?
15:31
ArjanCodes
Рет қаралды 31 М.
How to Debug Code Like a Pro
11:11
Lama Dev
Рет қаралды 58 М.
Climbing to 18M Subscribers 🎉
00:32
Matt Larose
Рет қаралды 14 МЛН