import yaml
yaml_dict={"sss":"111","ddd":"222"}
with open("a.yaml", "w") as f:
    yaml.safe_dump(yaml_dict,f,encoding='utf-8', allow_unicode=True)

with open("a.yaml") as f:
    yaml_dict = yaml.load(f)
    print(yaml_dict)

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2021-06-30
  • 2023-04-07
  • 2022-12-23
猜你喜欢
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2020-07-20
  • 2021-05-24
  • 2021-12-28
  • 2022-12-23
相关资源
相似解决方案