python 编码文件json.loads json.dumps时间:2021-08-31 09:28:16 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