Live data from Hacker News

Guide to Python Debugging

martinheinz.dev

31–40 of 149 posts

Re: Guide to Python Debugging

#31
post #30

if you are working with vscode, I highly recommand debugpy[1] or ptvsd[2] [1] https://github.com/microsoft/debugpy [2] https://github.com/microsoft/ptvsd

Are they the one(s) that will be called if you use the "start debugging" in GUI with official Python extension? Or different one?

Re: Guide to Python Debugging

#32

This is a bit of a weird article. It spends most of the time talking about logging, which is somewhat useful for debugging but not really. pdb gets a few lines of description, and that is about it. Personally, I can't live without Pycharm when working with Python purely because of how fantastic the debugging experience is. The integration with the interactive IPython shell is simply fantastic, and the live variable v…

Yeah I agree entirely on Pychaem debugger being awesome. But it’s no substitute for logging in production. Somethings just need to be logged, either for proof or those situations where you just can’t reasonably attach a Pycharm debugger.

Re: Guide to Python Debugging

#34
post #30

if you are working with vscode, I highly recommand debugpy[1] or ptvsd[2] [1] https://github.com/microsoft/debugpy [2] https://github.com/microsoft/ptvsd

Are they the one(s) that will be called if you use the "start debugging" in GUI with official Python extension? Or different one?

yes. vs code python extension uses debugpy.

Re: Guide to Python Debugging

#35

This is a bit of a weird article. It spends most of the time talking about logging, which is somewhat useful for debugging but not really. pdb gets a few lines of description, and that is about it. Personally, I can't live without Pycharm when working with Python purely because of how fantastic the debugging experience is. The integration with the interactive IPython shell is simply fantastic, and the live variable v…

I tried pycharm once and every time i started it up it had to index files for hours. Anybody got around that problem? I really like IntelliJ so I would love to give pycharm a try.

Re: Guide to Python Debugging

#37
post #35

This is a bit of a weird article. It spends most of the time talking about logging, which is somewhat useful for debugging but not really. pdb gets a few lines of description, and that is about it. Personally, I can't live without Pycharm when working with Python purely because of how fantastic the debugging experience is. The integration with the interactive IPython shell is simply fantastic, and the live variable v…

I tried pycharm once and every time i started it up it had to index files for hours. Anybody got around that problem? I really like IntelliJ so I would love to give pycharm a try.

You want to make sure PyCharm is only indexing files within your project. Depending on your setup, it can try to index all files within virtual environments etc.

Re: Guide to Python Debugging

#39

Earlier quoted context omitted.

I second PyCharm, not only from a debugging perspective but as a whole. I don't understand people struggling with generic text editors, development oriented text tools (sublime etc), or even vscode just because they are free when there is a much better tool money can buy (and PyCharm has a free, community version as well).

My main reason for wishing to be able to switch to Vscode instead of Pycharm is because vscode's remote development UX is really really nice and works a lot better for me compared to the Pycharm way of SFTP-ing files between your local and the remote. My use-case where Pycharm feels a bit deficient is that I have an Ubuntu deeplearning box at work that I can VNC into and develop on whenever needed. I have all my repo…

Btw, this is exactly this feature request: https://youtrack.jetbrains.com/issue/IDEA-226455

Current statement:

> We're very aware of how important this feature is, and we have several initiatives in place to provide a great experience for fully remote development. Unfortunately, at this time we're unable to share any specifics or timeframes, as getting the best possible experience requires massive-scale architectural changes to our codebase, but we've been working on this for quite some time already and we believe that we will have a solution that will go above and beyond what VS Code delivers today.

Re: Guide to Python Debugging

#40

I've been a Python developer for more than ten years. Approximately 98% of the time I need to debug something I use print() statements and this: import IPython; IPython.embed()

Oh, having full ipython during debug investigations is much better than using pure pdb.set_trace(). Thank you.
Post reply on HN