3 ms·
I love jq. Since I just learned this today, I'll mention that python comes with a JSON pretty-printing utility that can be used on the CLI: echo '{"some_json
by anderspitman 6y ago
I love jq. Since I just learned this today, I'll mention that python comes with a JSON pretty-printing utility that can be used on the CLI:
echo '{"some_json": "value"}' | python -m json.tool
- jasomill 6y agoProbably worth mentioning in this context that the pygments[1] module adds syntax coloring, as well, ... | python -m json.tool | python -m pygments -l json or, path permitting, ... | python -m json.tool | pygmentize -l json [1] https://pygments.org https://pygments.org
- jasomill 6y agoOh, and python -m http.server 12345 serves files in the current directory over HTTP on port 12345. I'll stop now, but I love how Python module developers add these "hidden" command-line features. P.S.: You can — and, at this point in history, probably should — s/python/python3/ in all these examples.
- deleted 6y ago[deleted]