From 9b90b407ed54c8fecee7e84d69701cfe951368ac Mon Sep 17 00:00:00 2001 From: Kyle K Date: Mon, 14 Sep 2020 01:45:19 -0500 Subject: parsing YAML example --- yaml1.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 yaml1.py (limited to 'yaml1.py') diff --git a/yaml1.py b/yaml1.py new file mode 100644 index 0000000..30feff3 --- /dev/null +++ b/yaml1.py @@ -0,0 +1,11 @@ +import yaml +import pprint as pp + +with open('config.yaml', "r") as f: + yamlconfig = yaml.load(f, Loader=yaml.FullLoader) + +#pp.pprint(yamlconfig) +#for i, d in yamlconfig.items(): +# print(i, ":", d) + +print(yamlconfig['server']['users'][0]['ssh_key']) -- cgit v1.2.3