Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save gmariette/a144b5363575e2489808f1e6167f5b74 to your computer and use it in GitHub Desktop.
Compare both lists
if paramListInParamFile == paramListInTemplateFile:
print ("Same parameters on both files")
else:
print ("Differences in parameters between both files !")
resultNotInParamFile = [x for x in paramListInTemplateFile if x not in paramListInParamFile]
if len(resultNotInParamFile) != 0:
resultNotInParamFileStr = ' '.join(map(str, resultNotInParamFile))
print("List of keys that are not present in the param file but are in the template : " + resultNotInParamFileStr)
resultNotInTemplateFile = [x for x in paramListInParamFile if x not in paramListInTemplateFile]
if len(resultNotInTemplateFile) != 0:
resultNotInTemplateFileStr = ' '.join(map(str, resultNotInTemplateFile))
print("List of keys that are not present in the template but present in param file : " + resultNotInTemplateFileStr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment