0

I have this yaml file below. I want to read the value from the yaml file and use an API to access a switch.

device.yaml

- hosts 
    host1: 192.168.1.1
    host2: 192.168.1.2

Here is the below python command I want to run using the value of host1

pe2=Server("http://admin:admin@host1/command-api")
LW001
  • 2,217
  • 4
  • 27
  • 34
  • https://stackoverflow.com/questions/1773805/how-can-i-parse-a-yaml-file-in-python for loading a YAML file – Nils Sep 13 '21 at 13:35

0 Answers0