📜  python yaml load_all - Python 代码示例

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

代码示例1
# pip install pyyaml

import yaml

with open('data.yaml') as f:
    docs = yaml.load_all(f, Loader=yaml.FullLoader)
    for doc in docs:
        for k, v in doc.items():
            print(k, "->", v)