python import yaml data = { } comments = { } with open('data.yaml', 'w') as file: yaml.dump(data, file, sort_keys=False, explicit_start=True, explicit_end=True, default_flow_style=False, allow_unicode=True) for key, value in comments.items(): file.write(f"# {key}: {value} ") yaml --- hobbies: ...


上一篇:
下一篇:
切换中文