PySnooper icon indicating copy to clipboard operation
PySnooper copied to clipboard

Feature request: Support showing source when it's a multiline string passed to `python -c`

Open cool-RR opened this issue 4 years ago • 2 comments

cool-RR avatar Dec 20 '20 11:12 cool-RR

better-exceptions actually does this (with heavy caveats) by looking up its pid in the output of a ps command to get the full command: https://github.com/Qix-/better-exceptions/blob/4e150ba3428013e55c274b06829b0360704d6750/better_exceptions/formatter.py#L149

This baffles me. Why are you running complicated code in python -c?

alexmojaki avatar May 09 '21 10:05 alexmojaki

better-exceptions actually does this (with heavy caveats) by looking up its pid in the output of a ps command to get the full command: https://github.com/Qix-/better-exceptions/blob/4e150ba3428013e55c274b06829b0360704d6750/better_exceptions/formatter.py#L149 Interesting, we might want to do the same.

This baffles me. Why are you running complicated code in python -c?

For the same reason PySnooper exists in the first place instead of just using a debugger: Because people suck.

cool-RR avatar May 09 '21 11:05 cool-RR