[BangPypers] Regarding 2 XML Files Comparision using Python
srijayanth at gmail.com
Thu Jun 4 12:22:37 CEST 2009
My name is Jayanth. I am new to BangPypers and Python in general. I have
been working on Ruby however so I am not lost or anything.
I wanted to point out that on ruby-lang several posters from India seem to
have no concept of how to phrase questions. They also lack the basic
curiosity to try common things before they go asking around for answers.
I've pondered for a long time why this phenomenon is particularly large here
whereas nearly everywhere else, even in countries where English is a
non-native language, people actually stick to basic etiquette.
Either the proportion of posters who ask for answers outright is really high
from India, or I am just being overly critical. What do you feel are some of
the reasons for this?
On Thu, Jun 4, 2009 at 3:40 PM, Ruchir Shukla <ruchiryshukla at gmail.com>wrote:
> okay sorry :)
> will keep in mind
> On Thu, Jun 4, 2009 at 3:20 PM, Venkatraman S <venkat83 at gmail.com> wrote:
>> On Thu, Jun 4, 2009 at 3:07 PM, Ruchir Shukla <ruchiryshukla at gmail.com>wrote:
>>> import difflib
>>> #print text1
>>> #print text2
>>> text1_lines = text1.splitlines(1)
>>> text2_lines = text2.splitlines(1)
>>> d = difflib.HtmlDiff()
>>> diff = d.make_file(text1_lines, text2_lines)
>>> print diff
>>> To find difference this program and *"difflib"* library can help you
>>> HtmlDiff will return the HTML format of the comparison.
>>> if u are looking for output in plain text format then following can help
>>> import difflib
>>> d = difflib.Differ()
>>> diff = d.compare(text1_lines, text2_lines)
>> Do NOT spoonfeed! *sigh*
>> BangPypers mailing list
>> BangPypers at python.org
> Ruchir Shukla
> BangPypers mailing list
> BangPypers at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the BangPypers