cool-RR / PySnooper

Never use print for debugging again
MIT License
16.31k stars 954 forks source link

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

Open cool-RR opened 3 years ago

alexmojaki commented 3 years ago

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?

cool-RR commented 3 years ago

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.