From d00d9369bbd64ea39444d92ff248717793e7a4ff Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 20 Aug 2020 10:58:09 -0700 Subject: [PATCH] Add directory_discrepancy.py. --- directory_discrepancy.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 directory_discrepancy.py diff --git a/directory_discrepancy.py b/directory_discrepancy.py new file mode 100644 index 0000000..c5fb3ec --- /dev/null +++ b/directory_discrepancy.py @@ -0,0 +1,20 @@ +import os +import sys + +dir1 = sys.argv[1] +dir2 = sys.argv[2] + +files1 = set(os.listdir(dir1)) +files2 = set(os.listdir(dir2)) + +print(f'In "{dir1}" but not in "{dir2}":') +print('=============================') +for discrepancy in files1.difference(files2): + print(discrepancy) + +print() + +print(f'In "{dir2}" but not in "{dir1}":') +print('=============================') +for discrepancy in files2.difference(files1): + print(discrepancy)