title: Comparing two text files and counting the differences
body: <p>I have been trying to compare two text files in Python, essentially I want to open them and compare a single character at a time if the characters are different add 1 to a counter and then display this value.</p>
  <p>Here is what I have so far:</p>
  <pre><code>#!/usr/bin/env python
  
  diff = 0
  
  import random
  import string
  import sys
  
  file_A = sys.argv[1]
  file_B = sys.argv[2]
  
  read_A=open(file_A,'r').read()
  read_B=open(file_B,'r').read()
  
  for a in read_A:
      for b in read_B:
          if a != b:
              diff = diff + 1
      return diff
  break
  
  print &quot;No of Differences &quot;,diff
  </code></pre>
  <p>Right now it does count but the value it returns does not seem correct.</p>