Damn, this saved my ass today. Had to run code line by line and check lots of variables throughout to figure out what was going wrong with a script. As I could only access the machine via terminal in an SSH session, I couldn't use VSCode's debugger. Thank you so much, bro!
Love that you were debugging the module you were trying to run. Good example of what happens when debug statements make it in to the code. Which is exactly what pre-commit is meant to prevent. Ahhhhhhhhhh
Nice video. I didn't know about `return`! Interesting that you find these more useful than conditional breakpoints, that is probably my most used feature. I guess this shows there are many different ways to approach debugging :) Like you, I have never managed to make tab completion work in pdb, I often drop down to full python with interact, but even that is sometimes hit or miss (when it comes to tab completion). Looking forward to the follow-up video on debuggers :)
conditional breakpoints are useful, but so so hard to explain (and usually I just do `if ...: breakpoint()` anyway). I used to have pdb tab complete working, but apparently I thought it was enabled by default in python3+ and deleted it!: github.com/asottile/scratch/commit/d713d95b2aa9af9f40db646788f65db75b7d4ee5#diff-2f794ea6c237446e15b2a2d127706060
Hey I want to learn how to code python. What do you recommend I do to start? I was thinking about just watching videos here on youtube. I took a cs 102 class which is for beginners in college but it was too fast pace for me as I knew nothing about coding previous to the course and I feel I did not learn from it because like I mentioned it was too fast paced for me and all I did was use chat gpt so I can keep up with assignments.
Any Python question I have had in the past 2 months, there's an #anthonyexplains video for it!! Thabk you!! Wanted to ask what's the difference between "type[X]" vs "Type[X]"??
Useful, saved me many times, thanks for sharing! Do you plan to make a more advanced debugging video, for example with threads and/or multiprocess library in use and how to debug it from CLI?
@@anthonywritescode Yeah, for me, it's also difficult to tackle. Right now I'm trying to solve it with some success using debugger in an IDE of my choice and works fairly well so far. If I need to debug for example why the thread responsible for sending data to the device under test didn't get proper TCP/IP data. Unfortunately, it's extra hard to do so when you don't have source code for this module because it's compiled using Cython AND you do so on windows.
it depends -- if you can get vs code's debugger working and you're more comfortable using that then by all means go with that route! I still think it's useful to know how to use a terminal debugger and terminal editor for situations where you won't have an IDE available -- but for primary daily-driving debugging an IDE is just fine!
Love your work, you have helped me a lot. Thank you mate.
This is something I should have learned when I was just starting. Thanks as always, Anthony!
Damn, this saved my ass today.
Had to run code line by line and check lots of variables throughout to figure out what was going wrong with a script. As I could only access the machine via terminal in an SSH session, I couldn't use VSCode's debugger.
Thank you so much, bro!
Love that you were debugging the module you were trying to run. Good example of what happens when debug statements make it in to the code. Which is exactly what pre-commit is meant to prevent. Ahhhhhhhhhh
lol yep, big oops there :) but a good result in the end!
@@anthonywritescode basically brought this video full circle.
13:20 thats dope, pre commit saves the day once more
Thanks!
Nice video. I didn't know about `return`! Interesting that you find these more useful than conditional breakpoints, that is probably my most used feature. I guess this shows there are many different ways to approach debugging :) Like you, I have never managed to make tab completion work in pdb, I often drop down to full python with interact, but even that is sometimes hit or miss (when it comes to tab completion). Looking forward to the follow-up video on debuggers :)
conditional breakpoints are useful, but so so hard to explain (and usually I just do `if ...: breakpoint()` anyway). I used to have pdb tab complete working, but apparently I thought it was enabled by default in python3+ and deleted it!: github.com/asottile/scratch/commit/d713d95b2aa9af9f40db646788f65db75b7d4ee5#diff-2f794ea6c237446e15b2a2d127706060
@@anthonywritescode thanks for pointing to your pdbrc :)
outstanding video anthonywritescode. I killed the thumbs up on your video. Keep up the superior work.
Hey I want to learn how to code python. What do you recommend I do to start? I was thinking about just watching videos here on youtube. I took a cs 102 class which is for beginners in college but it was too fast pace for me as I knew nothing about coding previous to the course and I feel I did not learn from it because like I mentioned it was too fast paced for me and all I did was use chat gpt so I can keep up with assignments.
it was helpful for me, thanks
Any Python question I have had in the past 2 months, there's an #anthonyexplains video for it!! Thabk you!!
Wanted to ask what's the difference between "type[X]" vs "Type[X]"??
check out my python 3.9 video! it goes over that
Useful, saved me many times, thanks for sharing!
Do you plan to make a more advanced debugging video, for example with threads and/or multiprocess library in use and how to debug it from CLI?
debugging threading / multiprocessing isn't easy at all! I've not found a good way to do it personally
@@anthonywritescode Yeah, for me, it's also difficult to tackle. Right now I'm trying to solve it with some success using debugger in an IDE of my choice and works fairly well so far. If I need to debug for example why the thread responsible for sending data to the device under test didn't get proper TCP/IP data. Unfortunately, it's extra hard to do so when you don't have source code for this module because it's compiled using Cython AND you do so on windows.
How do you debug a if statement in general. Also how do you debug a if statement in vs code? I want to see the results of the conditionals tests.
I would either make a conditional breakpoint, or evaluate the condition, or step through it
Does it make sense to use PDB or PUDB if your using VSC? Thanks for video!
it depends -- if you can get vs code's debugger working and you're more comfortable using that then by all means go with that route! I still think it's useful to know how to use a terminal debugger and terminal editor for situations where you won't have an IDE available -- but for primary daily-driving debugging an IDE is just fine!
Very good explanation, thank you. And so easy! Why don't more people use this?
Thank you so much, bro
How do i debug my life
Next up.. decorators, please?
lucky you! I already made a video about decorators: ua-cam.com/video/WDMr6WolKUM/v-deo.html
@@anthonywritescode Silly me 😂. I did a UA-cam search the other day in your channel, but somehow, this did not come up.
Thank you!
Well that was cool. I usually use iPython, cuz it's pretty.