From 983d4ddc1e2865ae3632e41f6dc0c64db2c33f87 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 20 Aug 2020 13:19:56 -0700 Subject: [PATCH] Sort discrepancy lists before printing. --- directory_discrepancy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/directory_discrepancy.py b/directory_discrepancy.py index c5fb3ec..c6cb312 100644 --- a/directory_discrepancy.py +++ b/directory_discrepancy.py @@ -9,12 +9,12 @@ files2 = set(os.listdir(dir2)) print(f'In "{dir1}" but not in "{dir2}":') print('=============================') -for discrepancy in files1.difference(files2): +for discrepancy in sorted(files1.difference(files2)): print(discrepancy) print() print(f'In "{dir2}" but not in "{dir1}":') print('=============================') -for discrepancy in files2.difference(files1): +for discrepancy in sorted(files2.difference(files1)): print(discrepancy)