Re: Using difflib to compare text ignoring whitespace differences

2006-12-20 Thread Gabriel Genellina
On 19 dic, 11:53, Neilen Marais <[EMAIL PROTECTED]> wrote: > Hi > > I'm trying to compare some text to find differences other than whitespace. > I seem to be misunderstanding something, since I can't even get a basic > example to work: > > In [104]: d =difflib.Differ(charjunk=difflib.IS_CHARACTER_J

Using difflib to compare text ignoring whitespace differences

2006-12-19 Thread Neilen Marais
Hi I'm trying to compare some text to find differences other than whitespace. I seem to be misunderstanding something, since I can't even get a basic example to work: In [104]: d = difflib.Differ(charjunk=difflib.IS_CHARACTER_JUNK) In [105]: list(d.compare([' a'], ['a'])) Out[105]: ['- a', '+