Python json字符串和字典相互转换

python   Unicode转dict

catetory_dict = json.loads(row['param'], encoding='utf-8')
catetory = catetory_dict['catetory']

把字典序列化成json字符串

params_dict['a_xpath'] = a_xpath
params_dict['a_title'] = a_title
params_json = json.dumps(params_dict, ensure_ascii=False, encoding='utf-8')

 

posted @ 2020-12-06 11:04  奇遇yms  阅读(189)  评论(0编辑  收藏  举报