echo '{"a": 1, "b": 2}' | python -m json.tool 转自: http://blog.csdn.net/chosen0ne/article/details/7308659