import difflib<br>f=open(&#39;text1.txt&#39;,&#39;rb&#39;)<br>text1=f.read()<br>f.close()<br>f=open(&#39;text2.txt&#39;,&#39;rb&#39;)<br>text2=f.read()<br>f.close()<br>#print text1<br>#print text2<br>text1_lines = text1.splitlines(1)<br>

text2_lines = text2.splitlines(1)<br>d = difflib.HtmlDiff()<br><br>diff = d.make_file(text1_lines, text2_lines)<br>print diff<br><br><br>To find difference this program and  <b>&quot;difflib&quot;</b> library can help you <br>

HtmlDiff will return the HTML format of the comparison. <br><br>if u are looking for output in plain text format then following can help you.<br><br>import difflib<br>d = difflib.Differ()<br>diff = d.compare(text1_lines, text2_lines)<br>

<br><div class="gmail_quote">On Thu, Jun 4, 2009 at 2:59 PM, testing123 test <span dir="ltr">&lt;<a href="mailto:swtest123@gmail.com">swtest123@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi all,<br>
       I am prasad.I need a help to write a python script to compare
two XML Files.Is there any tutorial.Should we include any
library?Please help me How to start?<br>
<br>
Rgds,<br>
Prasad

<br>_______________________________________________<br>
BangPypers mailing list<br>
<a href="mailto:BangPypers@python.org">BangPypers@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>------------------------------<br>Thanking You <br>Ruchir Shukla<br>