Tools, FAQ, Tutorials:
json.tool - JSON Pretty-Print Tool
What is json.tool? Can I use it to convert a JSON string a pretty-print format?
✍: FYIcenter.com
json.tool is a special internal executable module - a module with main() so you can run it as Python script.
When you run json.tool, (or json.module.main()), it will read a JSON string from the stand input and write the stand output in pretty-print format.
You can use the json.tool module from the command line:
C:\fyicenter> type sample.json ["foo", {"bar":["baz", null, 1.0, 2]}] C:\fyicenter> python -m json.tool < sample.json [ "foo", { "bar": [ "baz", null, 1.0, 2 ] } ]
You can also call the json.tool.main() from your Python script:
>>> import json.tool >>> json.tool.main() ["foo", {"bar":["baz", null, 1.0, 2]}] ^Z [ "foo", { "bar": [ "baz", null, 1.0, 2 ] } ] >>>
Note that you need to press Ctrl-Z to end the standard input stream.
⇒ 'urllib' Module - Internet Communication
⇐ json.loads() - Loading JSON into Object
2018-09-24, 2623🔥, 0💬
Popular Posts:
FYIcenter JSON Validator and Formatter is an online tool that checks for syntax errors of JSON text ...
What is EPUB 2.0 Metadata "dc:identifier" Element? EPUB 2.0 Metadata "dc:identifier" is a required m...
How to read Atom validation errors at w3.org? If your Atom feed has errors, the Atom validator at w3...
How To Open Standard Output as a File Handle in PHP? If you want to open the standard output as a fi...
How to pull NVIDIA CUDA Docker Image with the "docker image pull nvidia/cuda" command? If you are ru...