file diff script

This commit is contained in:
rasbt 2014-02-10 17:39:43 -05:00
parent 01af8c0a81
commit 6033ae9051
7 changed files with 21 additions and 0 deletions

0
README.md Normal file → Executable file
View File

0
closures.py Normal file → Executable file
View File

0
cpu_time.py Normal file → Executable file
View File

21
diff_files.py Normal file
View File

@ -0,0 +1,21 @@
# Sebastian Raschka, 2014
#
# Print lines that are different between 2 files. Insensitive
# to the order of the file contents.
id_set1 = set()
id_set2 = set()
with open('id_file1.txt', 'r') as id_file:
for line in id_file:
id_set1.add(line)
with open('id_file2.txt', 'r') as id_file:
for line in id_file:
id_set2.add(line)
diffs = id_set2.difference(id_set1)
for d in diffs:
print(d)
print("Total differences:",len(diffs))

0
get_filename.py Normal file → Executable file
View File

0
pickle_module.py Normal file → Executable file
View File

0
read_file.py Normal file → Executable file
View File