Using print is sometimes superior to pdb. If you want to quickly see how the program runs without stepping through each line print is justified. This looks like an evolved print. Nice tool!
PySnooper: Never use print for debugging again
31–40 of 175 posts
Re: PySnooper: Never use print for debugging again
#32Re: PySnooper: Never use print for debugging again
#33Interesting project, though I'd suggest losing the line about "can't be bothered to set one up right now" regarding a full debugger. (i)pdb is built in and is simple to use. Perhaps focus on what this can add rather than framing the project as something like a lazy alternative (especially when this may actually be harder to set up than throwing in "import pdb; pdb.set_trace()")? edit: spelling
I’d also lose the profanity. > You can use it in your shitty, sprawling enterprise codebase without having to do any setup. Debugging is a sensitive subject, particularly given how frustrating it can be. There’s a place for vulgarity somewhere, but I’d rather see your README provide authoritative info than crack jokes.
Re: PySnooper: Never use print for debugging again
#34But just in case if you from print cult, you will like https://github.com/gruns/icecream
Re: PySnooper: Never use print for debugging again
#35Re: PySnooper: Never use print for debugging again
#36Re: PySnooper: Never use print for debugging again
#37As a very mediocre ruby programmer, is there an equivalent in ruby to this? If you have a little pattern that is more clever than 'puts' everywhere, please share, it would be well received by at least one person out there. Thanks!
Re: PySnooper: Never use print for debugging again
#38Re: PySnooper: Never use print for debugging again
#39I just tried wrapping this around one of these functions in the django shell (actually shell_plus, but same thing). Just imported pysnooper, created a new function using `new_f = pysnooper.snoop()(original_f)` and called new_f on the realistic data and got a nice printout that included values and times.
Very useful.
Re: PySnooper: Never use print for debugging again
#40I come from the php world now coding in python. There used to be a very nice library from Symfony called VarDumper: https://symfony.com/doc/current/components/var_dumper.html that would just pretty print variables you dumped to the browser in an easy to consume form. Is there anything like this in python?