UIFlow Guide
JSON 是一种轻量级的数据交换格式,以下是JSON函数使用方法
from m5stack import *
from m5ui import *
from uiflow import *
from libs.json_py import *
import json
date = None
date = py_2_json({'author':'M5Stack','people':100,'device':'CoreS3','number':5})
print(json.dumps(date))
print(get_json_keys(date))
print(get_json_key(date, 'number'))
print(get_json_values(date))
print(get_json_keys_len(date))
set_json_elements(date, 'people', 101)
set_json_elements(date, 'devicetow', 'core2')
delete_json_elements(date, 'number')
print(json.dumps(date))
print(json.loads('{"string":"stack","number":100}'))
print(json.dumps(date))
set_json_elements(date, 'devicetow', 'core2')
date = py_2_json({'author':'M5Stack','people':100,'device':'CoreS3','number':5})
delete_json_elements(date, 'number')
print(get_json_key(date, 'number'))
print(get_json_keys(date))
print(get_json_keys_len(date))
print(get_json_values(date))
set_json_elements(date, 'people', 101)
print(json.loads('{"string":"stack","number":100}'))