No video

How to Debug and Watch Code Execution in Visual Studio Code - 60 Seconds to Code

  Рет қаралды 1,063

Faisal Akhtar

Faisal Akhtar

Күн бұрын

shorturl.at/fCFGQ
Welcome to 60 seconds to code where I show you how to code in 60 seconds or less.
Today you will learn debugging and watching code execution using breakpoints
The file you need to follow along in this video is linked in the description.
Step 1- Open the file in visual studio code and set breakpoints at line 7,8 and 9 by clicking in the small margin to the left of the line numbers.
Step 2 - Click the run menu on the left navigation and click run and debug. Select the python file option.
Step 3 - The debugger will stop at the first breakpoint. Breakpoints allow you to pause code execution and inspect what is happening with your code at that particular point. Click the continue button in the debugging bar to proceed to the next breakpoint.
Step 4 - At the next breakpoint, click the step over button. Step over allows you to execute the entire line without having to know the details of the execution in that line.
Step 5 - At the next breakpoint, click the step into button. Step into allows you to step into the execution of a function call. Use the step over and step into buttons to watch the code executing.
Step 6 - While you are watching a function execute, you can also watch the variable local to that function in the local window. As variables come in and out of scope, you will see them in locals window.
Step 7 - You can also see what function is calling what function in the call stack window. The call stack windows tells us that the main module is calling the find max function and we are currently executing the find max function. At any time, you can click stop to stop the debugger or reset to start the debugger from the start.
The code is available in a link in the description.
Congratulations, you’ve learned about debugging and watching code execution in visual studio code. For your homework, try using the debug console to change the value of a local variable while you are watching code execution and try to code a little every day because code is life.
Watching code execution and #debugging in #python #100DaysOfCode #301DaysofCode #60secondstocode
shorturl.at/fCFGQ

Пікірлер: 1
@kyonako2
@kyonako2 7 ай бұрын
Right to the point! Thanks for the video
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 353 М.
Tmux has forever changed the way I write code.
13:30
Dreams of Code
Рет қаралды 965 М.
Stay on your way 🛤️✨
00:34
A4
Рет қаралды 33 МЛН
ROLLING DOWN
00:20
Natan por Aí
Рет қаралды 10 МЛН
КАКУЮ ДВЕРЬ ВЫБРАТЬ? 😂 #Shorts
00:45
НУБАСТЕР
Рет қаралды 3,1 МЛН
GDB Tutorial
55:12
CS 246
Рет қаралды 67 М.
An Illustrated Guide to OAuth and OpenID Connect
16:36
OktaDev
Рет қаралды 579 М.
How do computers read code?
12:01
Frame of Essence
Рет қаралды 3,1 МЛН
How This New Battery is Changing the Game
12:07
Undecided with Matt Ferrell
Рет қаралды 192 М.
BREAKING: Apple is FINALLY Doing it!
18:06
Matter
Рет қаралды 375
Risking my life to save $5000
19:29
Linus Tech Tips
Рет қаралды 330 М.
How to Become a Software Engineer (Without a College Degree)
36:38
Difference between cookies, session and tokens
11:53
Valentin Despa
Рет қаралды 617 М.
AMD Fires Back: Zen 5 Gaming Performance Still In Dispute
21:54
Hardware Unboxed
Рет қаралды 106 М.
Stay on your way 🛤️✨
00:34
A4
Рет қаралды 33 МЛН