1# read_categories.py file
2
3import yaml
4
5with open(r'E:\data\categories.yaml') as file:
6 documents = yaml.full_load(file)
7
8 for item, doc in documents.items():
9 print(item, ":", doc)
10
1import yaml
2
3# Read YAML file
4with open("data.yaml", 'r') as stream:
5 data_loaded = yaml.safe_load(stream)