随笔分类 -  Json

摘要:str/arr 转 obj json_str = '{"name":"haha","age":18}' json_arr = '[1,2,3,"test"]' var obj1 = JSON.parse(json_str) var obj2 = JSON.parse(json_arr) obj 转 阅读全文
posted @ 2021-05-05 16:51 该显示昵称已被使用了 阅读(292) 评论(0) 推荐(0)
摘要:分类 1. 对象 2. 数组 允许的值 1. 字符串 2. 数值 3. 布尔 4. null 5. 对象 (不能是函数对象,只能是{"name":"test","age":18}) 6. 数组 阅读全文
posted @ 2021-05-05 16:34 该显示昵称已被使用了 阅读(108) 评论(0) 推荐(0)
摘要:基本 # 1. 【python字典】转json格式【str】 import json dic = {'a': 1, 'b': 2, 'c': 3} str1 = json.dumps(dic, sort_keys=True, indent=4, separators=(',', ':')) # 有换 阅读全文
posted @ 2020-12-25 11:28 该显示昵称已被使用了 阅读(2082) 评论(0) 推荐(0)