Python Forum
get only additions in difflib.unified_diff
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get only additions in difflib.unified_diff
#4
(May-08-2017, 02:56 AM)metulburr Wrote: im not worried about the newlines, just obtaining only additions VS deletions.
I don't think you have such an option - just filter out every line that doesn't start with +[space]
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Messages In This Thread
RE: get only additions in difflib.unified_diff - by volcano63 - May-08-2017, 08:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to compare specific elements of a TSV in difflib gonksoup 1 179 Jun-08-2024, 02:05 PM
Last Post: Gribouillis
  Cant use difflib with islice? gonksoup 2 463 Jan-22-2024, 01:07 PM
Last Post: deanhystad
  [difflib] read files with SequenceMatcher JamieVanCadsand 3 4,835 Sep-15-2017, 09:15 AM
Last Post: JamieVanCadsand

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020