I have below yml file and want to get Authority, Portfolio, ID, Parent, etc. in different variables. On top of this, I want a loop that will run over this element one by one. In this case for loop run will 2 times. each time with these values in variables.
I am able to read the file but how can I wrote a for loop and get all these values in variables.
with open(r'/configuration.yml') as file:
Config = yaml.load(file, Loader=yaml.FullLoader)
print(Config)
- Authority:ABC
- Portfolio:PR
- PortfolioID:1
- Parent:UU
- ProjectName:UU
- URLLogon:https://
- -
- Authority:ABC
- Portfolio:PR
- Parent:II
- ProjectName:MM
- URLLogon:https://