Im using difflib to mimic
What defines additional VS removals?
Im using it in this manner:
an example snippet output would be
I dont see any additional arguments to give such restrictions
Is this possible with just difflib or would it require string parsing to do?
git diff
between two files in python. It works as expected and as git diff
does it. However i am wondering if you can only get the additions of the different files?What defines additional VS removals?
Im using it in this manner:
1 2 3 4 5 6 |
if args[ 'diff' ]: old = open (args[ 'output' ]) new = output_str for line in difflib.unified_diff(old.readlines(), new.splitlines( True ), fromfile = old.name, tofile = 'current' , lineterm = '\n' ): print (line) old.close() |
Output:-9911 Church Creek Rd Lindley, NY 14858
-Thursday May 04, 2017 - Saturday May 06, 2017 Time: 7:00AM - 4:00PM
-Crafts, tools, kitchen items, yarn, power washer, ab roller, fishing poles too much to list.
+638 River Rd Lindley, NY 14858
+Saturday May 06, 2017 - Saturday May 13, 2017 Time: 9:00AM
+Everything must go!!!!!
is what i current get, when i only want to seeQuote:+638 River Rd Lindley, NY 14858
+Saturday May 06, 2017 - Saturday May 13, 2017 Time: 9:00AM
+Everything must go!!!!!
I dont see any additional arguments to give such restrictions
Is this possible with just difflib or would it require string parsing to do?
Recommended Tutorials: