| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| """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) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Enable :mod:`json` module to work as a script using the :option:`-m` switch: ``python -m json``. | ||
| See the :ref:`JSON command-line interface <json-commandline>` documentation. | ||
| Patch by Trey Hunner. |
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.