diff options
author | Kyle K <kylek389@gmail.com> | 2020-09-14 01:45:19 -0500 |
---|---|---|
committer | Kyle K <kylek389@gmail.com> | 2020-09-14 01:45:19 -0500 |
commit | 9b90b407ed54c8fecee7e84d69701cfe951368ac (patch) | |
tree | f278916ca3cb8e3386725f45e348a135ea2c4a5a /yaml1.py | |
parent | 40de87995b901f72a4dd1f394af3c20c24c73541 (diff) | |
download | PythonPractice-9b90b407ed54c8fecee7e84d69701cfe951368ac.tar.gz PythonPractice-9b90b407ed54c8fecee7e84d69701cfe951368ac.tar.bz2 PythonPractice-9b90b407ed54c8fecee7e84d69701cfe951368ac.zip |
parsing YAML example
Diffstat (limited to 'yaml1.py')
-rw-r--r-- | yaml1.py | 11 |
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']) |