mirror of
https://github.com/python/cpython.git
synced 2024-11-27 23:47:29 +01:00
21 lines
421 B
Python
21 lines
421 B
Python
|
"""Command-line tool to validate and pretty-print JSON
|
||
|
|
||
|
Usage::
|
||
|
|
||
|
$ echo '{"json":"obj"}' | python -m json
|
||
|
{
|
||
|
"json": "obj"
|
||
|
}
|
||
|
$ echo '{ 1.2:3.4}' | python -m json
|
||
|
Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
|
||
|
|
||
|
"""
|
||
|
import json.tool
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
try:
|
||
|
json.tool.main()
|
||
|
except BrokenPipeError as exc:
|
||
|
raise SystemExit(exc.errno)
|