Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are many different tools, but when I want to quickly understand what the code was doing I have been reaching for pysnooper: https://pypi.org/project/PySnooper/

Has a pretty nice and importantly colored output by default, which I find much easier to follow. In many cases snooping one specific function has done the job. It has an easy to use decorator to decorate any function without having to otherwise intercept the main python invocation or set something up at the start. Good for libraries etc.

pysnooper has mostly been enough for me but the "snoop" mentioned in the article seems to be a superset and more. Will have to give it a go next time.

Outside of this if I want to understand performance or more roughly what code paths are executing (and not a per-statement trace) then austin and py-spy are both amazing.. convert to flamescope and drop into flamescope.app.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: