JSON小筆記:格式問題

Image for post
Image for post
圖1
Image for post
Image for post
圖2

差別在哪裡呢?

如何幫圖2加上圖1的內容?

#使用Pythonimport json
with open('data.json', 'w') as f:
f.write('{"code":1,"msg":"OK","data":')
json.dump(list_data, f)
f.write('}')

Written by

Machine Learning / Deep Learning / Python / Flutter cakeresume.com/yanwei-liu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store