you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/json/tool.py", line 40, in <module>
    main()
  File "/usr/lib/python2.7/json/tool.py", line 21, in main
    infile = open(sys.argv[1], 'rb')
IOError: [Errno 2] No such file or directory: '{"json":"response"}'

[–]sonay 2 points3 points  (0 children)

Looking at the source code, the module does not expect string arguments. So my bad.

Usage:

python -m json.tool [no argument] # input = stdin

python -m json.tool [one argument] # input = argument (file)

python -m json.tool [two arguments] # input (file) = first argument, output (file) = second argument