2

I am using the Difflib module from python to compare two different files but i want it to ignore Whitespaces and Tabs. The API-Doc doesn't work for me and i tried a lot so that it will run but nothing worked.

I am using the HTMLDiff:

difference = difflib.HtmlDiff(difflib.IS_CHARACTER_JUNK(ch=' ')).make_file(compare_line_left, compare_line_right, file1dir, file2dir)

The ch=" " should work but it doesn't seem to work. I tried it with the builtin SequenceMatcher too but honestly i have no clue how to use it. The doc is a bit unclear for me.

Can someone help?

Thank you in advance!

kaya3
  • 47,440
  • 4
  • 68
  • 97
tadashi
  • 116
  • 6
  • See also https://stackoverflow.com/questions/14696476/can-difflibs-charjunk-be-used-to-ignore-whitespace (could be duplicate, although the only answer is not marked "solved" and is a link-only answer). – 9769953 Dec 07 '18 at 13:27
  • Thanks but i already tried it. Didn't work for me... – tadashi Dec 07 '18 at 13:29

0 Answers0