json.dumps(target_dict, indent=4) dumps()的indent参数默认为None, 修改为一定的数值即可 转载于:https://www.cnblogs.com/josephchuh/p/9212778.html