I am trying to check for differences between lines. This is my code:
from difflib import unified_diff
s1 = ['a', 'b', 'c', 'd', 'e', 'f']
s2 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'i', 'k', 'l', 'm', 'n']
for line in unified_diff(s1, s2):
print line
It prints:
---
+++
@@ -4,3 +4,9 @@
d
e
f
+g
+i
+k
+l
+m
+n
What happened to 'a', 'b', and 'c'? Thanks!
for line in unified_diff(s1, s2, n=0):
, wheren=0
for no context, then output ford
,e
, andf
will no longer show – Carcassonne