python yaml文件读写时间:2023-03-09 08:55:42 import yaml yaml_dict={"sss":"","ddd":""} 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)