Skip to content

Instantly share code, notes, and snippets.

@jd-war-eagle
Created November 9, 2016 19:03
Show Gist options
  • Save jd-war-eagle/977f8ddec35c66b069fc6d4fd399caf9 to your computer and use it in GitHub Desktop.
Save jd-war-eagle/977f8ddec35c66b069fc6d4fd399caf9 to your computer and use it in GitHub Desktop.
Parse and dump a YAML file's variables
#!/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