Это видео недоступно.
Сожалеем об этом.

python debugger crash course: pdb / breakpoint (beginner - intermediate) anthony explains

Поделиться
HTML-код
  • Опубликовано: 18 сен 2020
  • today I go over the python debugger (pdb) and the most common commands I use!
    - postmortem debugging: • postmortem debugging i...
    playlist: • anthony explains
    ==========
    twitch: / anthonywritescode
    dicsord: / discord
    twitter: / codewithanthony
    github: github.com/aso...
    stream github: github.com/ant...
    I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!

Комментарии • 33

  • @viniciushenrique8211
    @viniciushenrique8211 2 года назад +6

    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!

  • @TheMarksdaspark
    @TheMarksdaspark 13 дней назад +2

    Love your work, you have helped me a lot. Thank you mate.

  • @sillybuttons925
    @sillybuttons925 3 года назад +3

    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

    • @anthonywritescode
      @anthonywritescode  3 года назад

      lol yep, big oops there :) but a good result in the end!

    • @sillybuttons925
      @sillybuttons925 3 года назад

      @@anthonywritescode basically brought this video full circle.

  • @Quarky_
    @Quarky_ 3 года назад +5

    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 :)

    • @anthonywritescode
      @anthonywritescode  3 года назад +2

      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

    • @Quarky_
      @Quarky_ 3 года назад

      @@anthonywritescode thanks for pointing to your pdbrc :)

  • @KeyserTheRedBeard
    @KeyserTheRedBeard 2 года назад +2

    outstanding video anthonywritescode. I killed the thumbs up on your video. Keep up the superior work.

  • @beto5720
    @beto5720 2 года назад +1

    13:20 thats dope, pre commit saves the day once more

  • @user-ed7bs1mn9z
    @user-ed7bs1mn9z 3 года назад +3

    it was helpful for me, thanks

  • @oscarcortez5863
    @oscarcortez5863 10 месяцев назад

    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.

  • @d3stinYwOw
    @d3stinYwOw Год назад

    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
      @anthonywritescode  Год назад

      debugging threading / multiprocessing isn't easy at all! I've not found a good way to do it personally

    • @d3stinYwOw
      @d3stinYwOw Год назад

      @@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.

  • @Naz-yi9bs
    @Naz-yi9bs 3 года назад +1

    Does it make sense to use PDB or PUDB if your using VSC? Thanks for video!

    • @anthonywritescode
      @anthonywritescode  3 года назад +1

      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!

  • @quochuybui4693
    @quochuybui4693 2 года назад

    Thank you so much, bro

  • @Captinofthemudslayer
    @Captinofthemudslayer Год назад

    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.

    • @anthonywritescode
      @anthonywritescode  Год назад

      I would either make a conditional breakpoint, or evaluate the condition, or step through it

  • @Rhedak
    @Rhedak 2 года назад

    Very good explanation, thank you. And so easy! Why don't more people use this?

  • @AceofSpades5757
    @AceofSpades5757 2 года назад

    Well that was cool. I usually use iPython, cuz it's pretty.

  • @gabe5225
    @gabe5225 Год назад +1

    How do i debug my life

  • @fariss9743
    @fariss9743 3 года назад +1

    Next up.. decorators, please?

    • @anthonywritescode
      @anthonywritescode  3 года назад

      lucky you! I already made a video about decorators: ruclips.net/video/WDMr6WolKUM/видео.html

    • @fariss9743
      @fariss9743 3 года назад

      @@anthonywritescode Silly me 😂. I did a RUclips search the other day in your channel, but somehow, this did not come up.
      Thank you!