Skip to content

Instantly share code, notes, and snippets.

@shonenada
Created March 12, 2013 08:55
Show Gist options
  • Save shonenada/5141283 to your computer and use it in GitHub Desktop.
Save shonenada/5141283 to your computer and use it in GitHub Desktop.
Compare two files, show which line is not equal..
file1 = open("file1", "r")
file2 = open("file2", "r")
line1 = file1.readlines()
line2 = file2.readlines()
for i in range(0, len(line1)):
if(line1[i] != line2[i]):
print i+1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment