python 编码文件json.loads json.dumps时间:2022-01-19 06:44:37 import yaml d = {'name': '张三', 'age': '1'} print d jd = json.dumps(d, ensure_ascii=False, encoding='utf-8')) ud = json.loads(jd, encoding='utf-8') print ud ud = yaml.safe_load(jd, encoding='utf-8') print ud