好友
阅读权限10
听众
最后登录1970-1-1
|
本路人
发表于 2020-9-30 17:01
RT, 读取的json文件格式如
转换成
读取的json文件格式本来是
"skins": [
{
"name": "default",
"attachments": {
"attack": {
"attack": { "x": 43.55, "y": -5.92, "rotation": -87.37, "width": 160, "height": 150 }
},
"body": {
"body": { "x": 20.7, "y": -8.53, "rotation": -84.74, "width": 155, "height": 152 }
},
"body_op": {
"body_op": { "x": 5.83, "y": -7.58, "rotation": 66.09, "width": 57, "height": 75 }
},
.....
这样简单易读的树状格式, 但是经过我读取再保存后,
with open(json_path,'rb') as f:
params = json.load(f)
params['batch_size'] = 16
dict = params
......
with open('output.json', 'w') as f:
json.dump(fileJson, f)
输出的格式变成了{"skins":[{"name":"default","attachments":{"error":{"error":{"x":43.55,"y":-5.92,"height":150,"width":160,"rotation":-87.37}},"right_leg_2":{"right_leg_2":{"x":9.52,"y":0.91,"height":53,"width":26,"rotation":93.3}},"shadow.....
这样的单行格式..请问如何把json保存这种简单易读的树状结构,有什么插件或者方法吗 |
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|