Skip to content

Instantly share code, notes, and snippets.

@richieforeman
Created October 31, 2012 16:57
Show Gist options
  • Save richieforeman/3988282 to your computer and use it in GitHub Desktop.
Save richieforeman/3988282 to your computer and use it in GitHub Desktop.
Compare two simple files and return the differences
import sys
import os
def read_file(f, split="\n"):
return open(f).read().split(split)
list1 = read_file(sys.argv[1])
list2 = read_file(sys.argv[2])
for i in sorted(list(set(list1) - set(list2))):
print i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment