問題申論
JSON全名叫做JavaScript Object Notation,以純文字儲存及傳送的簡單結構化資料,用字串、數字、布林、陣列、物件或null儲存任何資料,陣列用list[],物件用dict{}。
python以json及pickle模組來讀取,如範例:
import json
test_dict = {'bigberg': [7600, {1: [['iPhone', 6300], ['Bike', 800], ['shirt', 300]]}]}
print(test_dict)
print(type(test_dict))
#dumps 將資料轉換成字串
json_str = json.dumps(test_dict)
print(json_str)
print(type(json_str))