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