Created
February 6, 2020 08:19
-
-
Save gmariette/fbe3ff382bb5c501f8eae6b3cc9aa457 to your computer and use it in GitHub Desktop.
Load both files and parse them
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
| 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