summaryrefslogtreecommitdiffstats
path: root/yaml1.py
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2020-09-14 01:45:19 -0500
committerKyle K <kylek389@gmail.com>2020-09-14 01:45:19 -0500
commit9b90b407ed54c8fecee7e84d69701cfe951368ac (patch)
treef278916ca3cb8e3386725f45e348a135ea2c4a5a /yaml1.py
parent40de87995b901f72a4dd1f394af3c20c24c73541 (diff)
downloadPythonPractice-9b90b407ed54c8fecee7e84d69701cfe951368ac.tar.gz
PythonPractice-9b90b407ed54c8fecee7e84d69701cfe951368ac.tar.bz2
PythonPractice-9b90b407ed54c8fecee7e84d69701cfe951368ac.zip
parsing YAML example
Diffstat (limited to 'yaml1.py')
-rw-r--r--yaml1.py11
1 files changed, 11 insertions, 0 deletions
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'])