6 ms·
The Python package PySnooper is pretty good for "fancy" print debug statements: https://github.com/cool-RR/pysnooper https://github.com/cool-RR/pysnooper I've
by ivan_ah 5y ago
The Python package PySnooper is pretty good for "fancy" print debug statements: https://github.com/cool-RR/pysnooper https://github.com/cool-RR/pysnooper
I've caught quite a few bugs using this show-me-all-locals() approach...
- DanielleMolloy 5y agoThis looks pretty neat indeed, thanks!
- Too 5y agoLooks equivalent to python -m trace --trace, which is part of standard installation.
- ivan_ah 5y agoI did't know about this option, and I just tried it. Seems to be waaaaay more verbose, but I guess it can be tweaked/customized. I tried it on a command line script that uses google libs and still waiting for stdin to come back... What I liked about pysnooper is the ability to snoop on a specific function and/or code block to focus on the work-in-progress section of code.