📅  最后修改于: 2022-03-11 14:46:34.975000             🧑  作者: Mango
pip install pyyaml
import yaml
with open("example.yaml", 'r') as stream:
try:
print(yaml.safe_load(stream))
except yaml.YAMLError as exc:
print(exc)