Advertisement
Guest User

Untitled

a guest
May 24th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. wifi_parm: &wifi_params
  2. ssid: 1
  3. key: 2
  4. test1:
  5. name: connectivity
  6. <<: *wifi_params
  7. test2:
  8. name: connectivity_5ghz
  9. <<: *wifi_params
  10.  
  11. import yaml
  12. import pprint
  13.  
  14. with open(r'C:UsersayaskolkPycharmProjectsuntitled1aaa.yaml', "r") as f:
  15. result = yaml.load(f)
  16. pprint.pprint(result)
  17.  
  18. {'test1': {'key': 2, 'name': 'connectivity', 'ssid': 1},
  19. 'test2': {'key': 2, 'name': 'connectivity_5ghz', 'ssid': 1},
  20. 'wifi_parm': {'key': 2, 'ssid': 1}}
  21.  
  22. {'test1': {'key': 2, 'name': 'connectivity', 'ssid': 1},
  23. 'test2': {'key': 2, 'name': 'connectivity_5ghz', 'ssid': 1}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement