Answers for "Consider yaml.safe_load() instead"

1

python yaml load_all

# 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)
Posted by: Guest on July-09-2020

Code answers related to "Consider yaml.safe_load() instead"

Python Answers by Framework

Browse Popular Code Answers by Language