- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiff_files.py
More file actions
Latest commit
executable file
·29 lines (22 loc) · 497 Bytes
/
Copy pathdiff_files.py
File metadata and controls
executable file
·29 lines (22 loc) · 497 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/python
importsys
file1=sys.argv[1]
file2=sys.argv[2]
f1=open(str(file1), "r").readlines()
f2=open(str(file1), "r").readlines()
#'''
#Can also use the code in quotes here:
set1=set(f1)
set2=set(f2)
printlist(set1.difference(set2))
'''
def diff(list1, list2):
c = set(list1).union(set(list2))
d = set(list1).intersection(set(list2))
return list(c - d)
diff = diff(f2, f1)
#print diff
for line in diff:
print line
'''
# or do "sort file1 file2 | uniq -u"