Skip to content

Instantly share code, notes, and snippets.

@GammaGames
Last active September 10, 2019 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GammaGames/3d6ce2e12709a36bb7784cbff698c57a to your computer and use it in GitHub Desktop.
Save GammaGames/3d6ce2e12709a36bb7784cbff698c57a to your computer and use it in GitHub Desktop.
Print json representation of yaml to check structure
from os import path
import yaml
import json
import sys
if len(sys.argv) < 2:
print("Please provide a file name")
quit()
filename = sys.argv[1]
with open(path.abspath(filename)) as f:
data = yaml.load(f, Loader=yaml.SafeLoader)
print(json.dumps(data, indent=4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment