mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
		
			
				
	
	
		
			20 lines
		
	
	
	
		
			421 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			20 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)
 |