Python Debugging (PyCharm + VS Code)

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น • 242

  • @xelaxander
    @xelaxander 9 หลายเดือนก่อน +123

    What separates mcoding from the rest of the Python TH-camr 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.

    • @_jaime.
      @_jaime. 9 หลายเดือนก่อน +10

      Totally agree, I feel like he's the only Python youtuber who's able to teach me something new on every single video

    • @jeroenvermunt3372
      @jeroenvermunt3372 9 หลายเดือนก่อน +1

      I am just replying to reinstate your comment, I couldn't agree more. He also is the only one who dives deep into 'boring' subjects, but which are essential for developers. For example this video, but also logging, packaging and testing.

  • @DominicCarrier
    @DominicCarrier 9 หลายเดือนก่อน +25

    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.

  • @LastTigerEyes
    @LastTigerEyes 9 หลายเดือนก่อน +17

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

  • @olo90
    @olo90 9 หลายเดือนก่อน +21

    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 😀

  • @adamfarquhar1279
    @adamfarquhar1279 8 หลายเดือนก่อน

    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.

  • @josephpierce8926
    @josephpierce8926 9 หลายเดือนก่อน

    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

  • @goost0852
    @goost0852 9 หลายเดือนก่อน +9

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

  • @DanielLavedoniodeLima_DLL
    @DanielLavedoniodeLima_DLL 9 หลายเดือนก่อน +1

    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

  • @powrusr
    @powrusr 9 หลายเดือนก่อน +1

    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! 💪

  • @user-bp6eh7en1v
    @user-bp6eh7en1v 9 หลายเดือนก่อน +8

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

  • @loic1665
    @loic1665 8 หลายเดือนก่อน

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

  • @replicaacliper
    @replicaacliper 7 หลายเดือนก่อน

    Super useful to people who aren't from a cs background, as a physicist i use Python all the time but I've never learned how to debug, I just place print statements everywhere haha

  • @mojo9Y7OsXKT
    @mojo9Y7OsXKT 9 หลายเดือนก่อน

    As far as a beginner live debug tutorial is concerned #mcoding has done an excellent job in this vid. I am a seasoned quant programmer and tend to often develop code in live debugging mode. With interpreted languages like python and matlab this is not as important, but with something like C/C++ its very handy.

  • @danielschmider5069
    @danielschmider5069 7 หลายเดือนก่อน

    good video, you'd be surprised how many people never learned to properly debug and just use print debugging.
    Nothing against print debugging if it gets the job done, but in my experience it takes more trial and error because you have to know what to print first - while debugging gives you the chance to inspect all variables during runtime and see them go through different states and values. You end up finding the problem so much quicker, and never have to delete your print statements after you're done debugging.
    thank you #mcoding

  • @TheMathman7
    @TheMathman7 9 หลายเดือนก่อน +1

    Breaking on uncaught exceptions is very handy as well!

  • @sebsafari
    @sebsafari 9 หลายเดือนก่อน

    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.

  • @drBnpD
    @drBnpD 9 หลายเดือนก่อน

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

  • @jeffglass5196
    @jeffglass5196 9 หลายเดือนก่อน

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

  • @failgun
    @failgun 9 หลายเดือนก่อน

    This is the main problem I had with my university's Python course, we did 12 weeks of it, and they introduced lots of concepts - variables, strings, types, functions, classes, etc. It wasn't bad for an intro-to-programming course taught with Python. But they didn't mention how to use our IDE's debugging tools _once_ . I found out about it later and I was baffled that they willingly let us believe there was no better alternative than littering our code with print statements (this was even encouraged) to figure out what was going on.

  • @Excgo
    @Excgo 9 หลายเดือนก่อน

    @mCoding The code you have given in the git repo is the already fixed version. Is that by decision or should the buggy version be in the repo?

  • @FrancisCharetteMigneault
    @FrancisCharetteMigneault 9 หลายเดือนก่อน +1

    Thanks for the info about PyCharm's setting for Python 3.12 debugging. That will be useful in a near future for sure! #mcoding

    • @RoysIdea
      @RoysIdea 7 หลายเดือนก่อน

      Alas I can’t place a comment in the main thread, so hope someone or #mcoding is able to answer how to debug when starting from the command line with arguments. Otherwise I’m forced to use the print statements

  • @nlioc4
    @nlioc4 9 หลายเดือนก่อน

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

  • @aliwelchoo
    @aliwelchoo 9 หลายเดือนก่อน

    Conditional breakpoints is a big new one for me. Will be using that! Only thing I don't understand is why your pycharm debugger doesn't drop straight into a breakpoint upon exception?

  • @castercs
    @castercs 9 หลายเดือนก่อน +1

    em stupid question .. do you have some python course? Udemy or similar

  • @Phaust94
    @Phaust94 9 หลายเดือนก่อน +1

    #mcoding
    Man, 6 years into Python development and never knew about conditional breakpoints in PyCharm. Sweet!

  • @AFurreh
    @AFurreh 9 หลายเดือนก่อน

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

  • @levatius4397
    @levatius4397 9 หลายเดือนก่อน +1

    I am always surprised how many people don’t know about live debugging, also big PyCharm fan 🎉 #mcoding

  • @Mayur7Garg
    @Mayur7Garg 9 หลายเดือนก่อน

    Conditional breakpoints in VSCode also allows for hit counts and triggered breakpoints instead of expressions. Hit count based breakpoints are good for loops and triggered breakpoints are good when you want to break only when a previous breakpoint was hit. #mcoding

  • @Schlynn
    @Schlynn 9 หลายเดือนก่อน

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

  • @ilyagrant
    @ilyagrant 9 หลายเดือนก่อน

    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

  • @stevengorlich4993
    @stevengorlich4993 9 หลายเดือนก่อน

    #mcoding after 10 years with python, I still learn new stuff with your videos. I pushed my C-board to give us professional pycharm licences, wished I had a personal one as well :)

  • @dataplatter
    @dataplatter 9 หลายเดือนก่อน

    What about testing code that might not get run in normal circumstances?
    Also, is there a way to step back in program state? #mcoding

  • @justingerber9531
    @justingerber9531 9 หลายเดือนก่อน

    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!

  • @sethdhanson
    @sethdhanson 9 หลายเดือนก่อน

    Why are there comments in the .json file that vs code creates? If I try to put comments like that in my .json file, I get a warning they’re not permitted.

  • @jeevan1016
    @jeevan1016 9 หลายเดือนก่อน

    What is the efficient way to debug a function that is used in threading?
    Please give us some insights on this topic.

  • @SyberiaK
    @SyberiaK 9 หลายเดือนก่อน

    As a professional print debugger user, I'm absolutely amazed that these live debuggers exist :D
    You did a great job explaining them #mcoding

  • @NicolasJoye
    @NicolasJoye 9 หลายเดือนก่อน

    Thanks, Jetbrains, for providing the licenses!!!

  • @thegothaur
    @thegothaur 9 หลายเดือนก่อน

    Nice video. I noticed that, for some reason I don't understand, Pycharm debugger doesn't work if code is async and I have to use pdb :(

  • @Th3Vitamine
    @Th3Vitamine 9 หลายเดือนก่อน

    Next logical step to cover would be remote debugging, and maybe some cli variants, like pudb. Also a neat feature is python cells in VSCode (denoted by #%%) #mcoding

  • @nHans
    @nHans 9 หลายเดือนก่อน +1

    So you're saying that as far as the contest is concerned, the winners are determined by random draw, so the quality and relevance of my comment doesn't matter? All I need to do is type #mcoding somewhere in my comment? Awesome!

  • @mattjax16
    @mattjax16 9 หลายเดือนก่อน +2

    Jetbrains debugger is why I fell in love with jetbrains products in the first place vs code can’t compare lol

    • @mattjax16
      @mattjax16 9 หลายเดือนก่อน

      Well I’m sure it can but I don’t feel like learning until now lol

  • @adrianfletcher8963
    @adrianfletcher8963 9 หลายเดือนก่อน +3

    I finally ripped the bandaid and used the debugger for the first time 😅. I was like wow all these print statements are so useless. I'm glad mCoding is scratching the itch further. He said to debug in his python nooby video, but it still doesn't mean that we got that full tutorial #mcoding

    • @Ignisami
      @Ignisami 9 หลายเดือนก่อน +1

      Print statement debugging is never *entirely* useless. Code can behave differently when you're in the debugger. To give but one reason: Each step of the code takes longer (because you're reading what the debugger says, for one), things have all the time in the world to resolve before moving on. When you actually run the code normally that may not always be the case.

    • @adrianfletcher8963
      @adrianfletcher8963 9 หลายเดือนก่อน

      @@Ignisami That's true. I think I'm still getting used to the capability and am having "everything is a nail" syndrome at the moment t

  • @robotnaoborot
    @robotnaoborot 9 หลายเดือนก่อน

    you can put import pdb;pdb.set_trace() in your code to debug it without using editor. I think it's at least worth mentioning

  • @pipurs
    @pipurs 9 หลายเดือนก่อน

    I can safely say that the debugger, any debugger as a matter of fact, has been my best tutor. Not only regarding my own code, or my college's code, but also down there in the nitty gritty of things. But then I'm a 100% autodidact - which means that I've stared at some amount of exceptions through my years...
    Debuggers ftw.

  • @fluffykitties9020
    @fluffykitties9020 9 หลายเดือนก่อน

    very interesting, printing can become unbearable. this is also a great way to learn coding. i'm a vscode user but wouldn't mind trying pycharm.

  • @JaredJeyaretnam
    @JaredJeyaretnam 9 หลายเดือนก่อน

    My only issue with debugging is that it’s super slow compared to running properly. I’m using Python to do physics computation so I normally do print debugging instead unless I absolutely have to!
    Also, I have no idea how to debug numba-jitted functions lol

  • @NikitaSerditov
    @NikitaSerditov 9 หลายเดือนก่อน

    #mcoding is a truely useful Python programming channel. Thanks a lot.

  • @MattiasBrunschen
    @MattiasBrunschen 9 หลายเดือนก่อน

    Just started to use vscode, so your hints are very helpful. Thank you, #mcoding .

  • @cyberduck4923
    @cyberduck4923 9 หลายเดือนก่อน

    Another great video from the best-produced Python channel on TH-cam!
    #mcoding

  • @BartDorlandt
    @BartDorlandt 9 หลายเดือนก่อน

    Thank you for yet another great video. Quite nice you showed both vscode and pycharm!
    #mcoding

  • @marekmdpdesign
    @marekmdpdesign 9 หลายเดือนก่อน

    Nice, learned few new things when it comes to debugging :) - btw what does mean in your test code for e.g.: „actual = load_recipes(…)” - the three dots as arguments?
    #mcoding

    • @vytah
      @vytah 9 หลายเดือนก่อน +1

      ... is the ellipsis literal. It's an object of type EllipsisType, similar to how 1 is an object of type int

  • @timothyhumphreys1231
    @timothyhumphreys1231 9 หลายเดือนก่อน

    As a professional print debugger myself I found this video super helpful! #mcoding

  • @kitschlab
    @kitschlab 9 หลายเดือนก่อน

    Thank you #mcoding for this!
    I can't believe I never used the python debugger. Can't wait to try it out.

  • @archiemarqx
    @archiemarqx 9 หลายเดือนก่อน

    I use python for Data Science, so in this case I use both, VS Code for coding in Jupyter Notebbok and PyCharm for Python, and this combination works like a charm to me #mcoding

  • @danielohara5749
    @danielohara5749 9 หลายเดือนก่อน

    I just converted to an ide. I'm an old time coder and just used an editor. Ide found typos straight away. Took me a few days to realize I'll never go back.

  • @FighterAceee94
    @FighterAceee94 9 หลายเดือนก่อน

    How do you debug your code when the application just closes with some random exit code number, without any exceptions raised?

    • @aflous
      @aflous 9 หลายเดือนก่อน

      Just start debugging from the beginning 😅

  • @NimeshVellera
    @NimeshVellera 9 หลายเดือนก่อน

    #mcoding is one of the best TH-camrs in the python space. His videos are simply amazing.

  • @potzko2552
    @potzko2552 9 หลายเดือนก่อน +1

    tbh I find that the breakpoint() function is a bit of the best from both worlds of a live debugger and print debugging
    I usually put it behind an if :)
    #mcoding

  • @cristianbitica8204
    @cristianbitica8204 9 หลายเดือนก่อน

    I'm surprised of how much I can learn from these videos. #mcoding

  • @spaghettihair
    @spaghettihair 9 หลายเดือนก่อน

    You can set the pycharm debugger to break on exceptions!

  • @harshmodi5627
    @harshmodi5627 9 หลายเดือนก่อน

    Knowing how to debug makes life so much easier #mCoding

  • @gregkeith9521
    @gregkeith9521 9 หลายเดือนก่อน

    Reminds me of VBA debugging. Very good explanation #mcoding

  • @АртемФедоров-ю7б
    @АртемФедоров-ю7б 9 หลายเดือนก่อน

    It worth mentioning that before debugging, engineer must read log message first, maybe he can get some clue there

  • @fairphoneuser9009
    @fairphoneuser9009 9 หลายเดือนก่อน +1

    Print debugging is sadly so popular that people don't even care about real debugging and don't know its capabilities.
    But this doesn't mean that I'm not using print debugging for some specific purposes.
    #mcoding

  • @DarkosLab
    @DarkosLab 9 หลายเดือนก่อน

    If I am 99% sure I know where and what the bug is I'll print debug to verify. But if im not sure where or why a bug is happening live debug is the way to go.

  • @Jakub1989YTb
    @Jakub1989YTb 9 หลายเดือนก่อน

    pycharm has the best debugger in the business!!
    #mcoding

  • @moejo8187
    @moejo8187 9 หลายเดือนก่อน

    I didn't know the conditional breakpoints. Thanks for the explanation.
    #mcoding

  • @SBalajii
    @SBalajii 9 หลายเดือนก่อน

    Debugging is especially valuable when working with old code. print debugging is still fine in most of my hobby projects though..
    #mcoding

  • @hargrav3s740
    @hargrav3s740 9 หลายเดือนก่อน

    Love a nice debugging session breakdown, when I joined the industry, live debuggers truly are king! (That and good logs) #mcoding

  • @richwiss
    @richwiss 9 หลายเดือนก่อน

    Hey! Thanks for the videos (as always). Been a long time vscode user but would be super happy to try pycharm! #mcoding

  • @jasperkousen5470
    @jasperkousen5470 9 หลายเดือนก่อน +1

    Thanks for all the great content!

  • @moonskined
    @moonskined 9 หลายเดือนก่อน

    I recently started learning python so this was very helpful. Thank you. #mcoding

  • @kall2075
    @kall2075 9 หลายเดือนก่อน

    #mcoding need more videos like this. Preferably on more complex code base where the issue is on the import code

  • @jesusromero9167
    @jesusromero9167 7 หลายเดือนก่อน

    This is gold! It would be amazing if you make a series of how to use pycharm the way is intended #mcoding

  • @tooru
    @tooru 9 หลายเดือนก่อน

    Of course I want a license too #mcoding but still thank you for producing such useful and polished content. We can see that you care about making it better.

  • @nikitkuzi
    @nikitkuzi 9 หลายเดือนก่อน

    What are the best beginner projects to fill your portfolio and to gain experience that you can recommend? #mcoding

  • @shabik3
    @shabik3 9 หลายเดือนก่อน

    Noice, this is a holy grail of python vids!! :D

  • @yt-1161
    @yt-1161 9 หลายเดือนก่อน

    what computer are you using ? #mcoding

  • @XDjUanZInHO
    @XDjUanZInHO 9 หลายเดือนก่อน

    As always, going the other mile to show everything deeper than the surface level content #mcoding

  • @brainforest88
    @brainforest88 9 หลายเดือนก่อน

    Nice. How do you like the new UI of PyCharm? #mcoding

  • @Acuzzio
    @Acuzzio 9 หลายเดือนก่อน

    What an excellent video. Thanks a lot.

  • @kayebennett7867
    @kayebennett7867 9 หลายเดือนก่อน

    #mCoding, usually I enjoy your videos because you really go deep into the details, but I felt that you only touched the surface on this one. I don't use pycharm or vscode but I imagine that you can also use pdb commands, I think these are really useful for proper debugging. For example, in 15:12, you could have just used the "until" command to exit a loop instead of setting a breakpoint that you have to remove immediately after.

  • @redbeangreenbean
    @redbeangreenbean 9 หลายเดือนก่อน

    This was immensely helpful. Thanks #mcoding!

  • @luketurner314
    @luketurner314 9 หลายเดือนก่อน

    5:28 *ten items, it even tells you at the bottom with __len__; classic off-by-one error
    and again at 9:56 *eleven

  • @JstnJy637
    @JstnJy637 9 หลายเดือนก่อน

    I am not a developer but I use python on a daily basis. And I am a "print guy". This will surely be very helpful for me. Swag. #mcoding.

  • @Landee
    @Landee 9 หลายเดือนก่อน +1

    Need more beginner tips !! #mcoding

  • @igorb2216
    @igorb2216 9 หลายเดือนก่อน

    PyCharm licence you just said? I'm all in! #mcoding

  • @ginggung2413
    @ginggung2413 9 หลายเดือนก่อน

    very nice job highlighting the usefulness and ease of use. Course I'd also love a piece xD #mcoding

  • @BrandonSolo
    @BrandonSolo 9 หลายเดือนก่อน

    I'#mcoding and debugging so much better thanks to this channel (padum tsssss)

  • @maciejbrzeski9740
    @maciejbrzeski9740 9 หลายเดือนก่อน

    Wonderul video as always. I learn a lot new things every time. Thanks for all your effort that you put in those videos! #mcoding

  • @mytelevisionisdead
    @mytelevisionisdead 9 หลายเดือนก่อน

    Pycharm is where it's at!!! ❤❤ 🙏 #mcoding

  • @Articha
    @Articha 9 หลายเดือนก่อน

    Sometimes info from videos shock me. Keep going, James! #mCoding

  • @misha.teppich
    @misha.teppich 9 หลายเดือนก่อน

    Would like to tryout PyCharm and use pro license features. #mcoding

  • @nikolastamenkovic7069
    @nikolastamenkovic7069 6 หลายเดือนก่อน

    Throughout this tutorial I thought to myself, at least five times - "Oh, how exciting video this is!"
    What a nerd I am.....

  • @plato4ek
    @plato4ek 9 หลายเดือนก่อน

    Woo-hoo! Another contest! #mcoding

  • @Seun_O
    @Seun_O 9 หลายเดือนก่อน

    I learned something new. Thanks for the high quality content #mcoding

  • @EvanBerkowitz
    @EvanBerkowitz 9 หลายเดือนก่อน

    I didn't even know there WAS a free edition of pycharm. Hope they treat you well #mcoding!

  • @Mayur7Garg
    @Mayur7Garg 9 หลายเดือนก่อน

    I personally prefer VSCode so that I can have the same IDE for all my projects and languages. #mcoding

  • @AjayThakur-ed9cj
    @AjayThakur-ed9cj 9 หลายเดือนก่อน

    #mcoding Nice, very informative. everyone should prefer pycharm.

  • @ChristopherFerguson
    @ChristopherFerguson 9 หลายเดือนก่อน

    I always find your videos so helpful. Thanks so much! #mcoding