Created
November 9, 2016 19:03
-
-
Save jd-war-eagle/977f8ddec35c66b069fc6d4fd399caf9 to your computer and use it in GitHub Desktop.
Parse and dump a YAML file's variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
from yaml import load, dump | |
if not len(sys.argv) > 1: | |
raise Exception('Must pass path to yaml file') | |
print('Dumping parsed YAML values from {}\n'.format(sys.argv[1])) | |
with open(sys.argv[1]) as yaml_file: | |
print(dump(load(yaml_file))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment