9951 explained code solutions for 126 technologies


pythonHow to read yaml file


import yaml

with open('file.yml') as f:
  data = yaml.load(f)ctrl + c
import yaml

import library to work with YAML

'file.yml'

path to our YAML file

yaml.load

loads YAML from file and parses it into dictionary

data

this dictionary will store parsed data