title: How calculate Diff in python
body: <p>I have two strings: <em>stringA</em> and <em>stringB</em>.</p>
  
  <p>I want to calculate difference between <em>stringA</em> and <em>stringB</em> such that it only contains the difference between both. If I apply the difference on <em>stringA</em>, I should be able to get <em>stringB</em>. </p>
  
  <p>In python there is <code>difflib</code>, but it does not computer diff as above it almost saves the content of both strings.</p>
  
  <p>Example:</p>
  
  <pre><code>stringA = "apple\nball\n"
  stringB = "apple\ncat\n"
  </code></pre>
  
  <p>Now difference should look like <code>-2,+2cat\n</code>, its just an example but I want difference to be minimum information. </p>
  
  <p>Now if I apply the above difference to <em>stringA</em> I should get <em>stringB</em>.</p>