Skip to content

Instantly share code, notes, and snippets.

@gmariette
Created February 6, 2020 08:19
Show Gist options
  • Select an option

  • Save gmariette/fbe3ff382bb5c501f8eae6b3cc9aa457 to your computer and use it in GitHub Desktop.

Select an option

Save gmariette/fbe3ff382bb5c501f8eae6b3cc9aa457 to your computer and use it in GitHub Desktop.
Load both files and parse them
import json
import yaml
f = open('myparamfile.json')
dataParam = json.load(f)
f.close()
with open('mytemplatefile.yaml', 'r') as y:
dataTemplate = yaml.load(y, Loader=yaml.BaseLoader)
paramListInParamFile = []
for k in dataParam:
paramListInParamFile.append(k['ParameterKey'])
paramListInTemplateFile = []
for kk in dataTemplate['Parameters']:
paramListInTemplateFile.append(kk)
paramListInParamFile.sort()
paramListInTemplateFile.sort()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment