Created
February 6, 2020 08:39
-
-
Save gmariette/a144b5363575e2489808f1e6167f5b74 to your computer and use it in GitHub Desktop.
Compare both lists
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
| 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