Python Debugging (PyCharm + VS Code)

preview_player
Показать описание
Step by step through your program.

Debugging is an essential and unavoidable part of programming. Everyone writes bugs, and we'd like to get rid of them. Print statements are fine to a certain point, but live debugging is usually a better option. With live debugging, you can step through your program one statement at a time, and set breakpoints at interesting places to stop, view, and interact with the state of the program before it proceeds. This is a very beginner-friendly tutorial on how to use PyCharm and VS Code for live debugging in Python.

CONTEST CURRENTLY CLOSED! The winners have been contacted.

OFFICIAL CONTEST RULES:
2. YouTube is not a sponsor of the contest and viewers are required to release YouTube from any liability related to the contest.
3. Privacy notice: no personal data will be collected for this contest.
4. In order to enter, you must (a) be one of my subscribers, AND (b) make a top-level comment to the video including #mcoding somewhere in the comment.
5. The contest is free, there is no fee required to enter.
6. Winners will be chosen randomly 1 week after the date the video went live from all users who have entered and not been disqualified.
7. Each winner will be notified via a comment reply from me that details what prize was won (e.g. "Congratulations! You have won XYZ. Please email me."). I will ask the winner to contact me by email, and I will reply through email with a random token which must be posted as another reply to the winning comment from the winning account in order to verify account ownership and prevent fraud.
8. Each winner will have 72 hours to respond AND prove account ownership or their prize is automatically forfeited and another winner will be chosen.
9. A winner can only win 1 prize per contest.
11. You may not enter the contest if doing so would be a violation of any relevant federal, state, and local laws, rules, and regulations, including U.S. sanctions.

SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!

Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)

Want to donate crypto? Check out the rest of my supported donations on my website!

Top patrons and donors: Laura M, Dragos C, Jameson, Neel R, Jameson, Pi, Matt R, Vahnekie Johan A, Mark M, Mutual Information

BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------

CHAPTERS
---------------------------------------------------
0:00 Intro
1:28 Grocery app
3:56 Debugging in PyCharm
12:23 Conditional breakpoints
16:09 Debugging in VS Code
21:49 A useful tip... TESTING
23:38 Outro
Рекомендации по теме
Комментарии
Автор

What separates mcoding from the rest of the Python YouTuber crowd is the fact that even before watching the video, I know my time won’t be wasted. Love your work, hope you consulting company is doing well.

xelaxander
Автор

As an entirely self-taught software developer, I can attest that these kind of introductory videos are always great. It never assumes "well known knowledge". #mcoding is a very nice resource for all skill levels.
Love the channel.

DominicCarrier
Автор

I am always impressed how I still learn things from your videos, even on topics I'm familiar with already (TIL about conditional breakpoints).

LastTigerEyes
Автор

Finally a video on debugging for Python. Haven't even watched it yet but I've got big hopes that this will be the video I'll send to every new intern & junior in our team at work 😀

olo
Автор

I've found setting up the debugging in VS Code to be surprising. Now I know it's not just me! Thanks for the clear explanations and work-arounds for the quirks in the PyCharm and VS Code debugger settings.

adamfarquhar
Автор

Whoa! Another gem from #mcoding! 🌟 Clear, conceptual, and oh-so-needed. Keep 'em coming! 🚀

drBnpD
Автор

Wanted to say thanks. I didn't know any of this, and it seems super useful. Bonus tip for anyone who has to run their code from the command line, you can add the call breakpoint() in your source file and then use the debugger from the terminal

josephpierce
Автор

Since you recommend testing, I'd love to see more content on testing the hard stuff like API's, files, databases with pytest. Testing static code is easy the IO stuff is more complicated. Thanks for the nuggets! 💪

powrusr
Автор

your videos are actually so helpful in my Python coding journey

subswithnovideos-zkls
Автор

13:47 really nice to see him laugh at something goofy like this 😄 #mcoding

bpehenv
Автор

Using the debugger is something that I've procrastinated learning since I began programming in university 10 years ago. Nice to see such a comprehensive video about that topic #mcoding

DanielLavedoniodeLima_DLL
Автор

Really been enjoying your videos alot more recently as I've been diving deeping into Python. Thank you for the upload.

Schlynn
Автор

Genuinely had no idea about conditional breakpoints. Big time saver! #mcoding thank you much for going in to this topic!

AFurreh
Автор

Wow super helpful video! I've used the debugger for a while but seeing your methodology to it was insightful.

I would have changed the data in the file rather than the function, but you don't always have that luxury.

seb
Автор

Genuinely, I applied some new things I learned from this video within half an hour. Thank you for all you do. #mcoding

jeffglass
Автор

Again and again you manage to talk about things that I dealt with but never knew how they should be applied. Thanks for your content!
#mcoding

ilyagrant
Автор

Great video ! Love the last advice about unit testing! I've personally had to debug asyncio app and it's really hard!

loic
Автор

I swear every time I think about wanting to learn something, #mcoding posts a video about it the next day

nlioc
Автор

More basic than the usual, but still a nice refresher :)

goost
Автор

Awesome video as usual! I never knew about conditional break points, seems super useful, I’ll have to try them out! Also I’ve been learning and implementing testing lately. It’s hard to write good tests, but once tests are written it is such a joy to refactor and improve code knowing you have your tests as a sort of safety net. Thanks for the video #mcoding!

justingerber