📜  python yaml 解析器 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:34.975000             🧑  作者: Mango

代码示例2
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)