最後活躍 6 months ago

diff-check-txt.py 原始檔案
1file1 = "misc.txt"
2file2 = "misc1.txt"
3
4with open(file1) as f:
5 a = set(line.strip() for line in f)
6
7with open(file2) as f:
8 b = set(line.strip() for line in f)
9
10print("---- Lines in misc.txt but NOT in misc1.txt ----")
11for x in sorted(a - b):
12 print(x)
13
14print("\n---- Lines in misc1.txt but NOT in misc.txt ----")
15for x in sorted(b - a):
16 print(x)