python diff code example
Example: python html diff
from pprint import pprint def transform_text(lines): """ Code to transform the lines array """ """ e.g. strip blank white spaces, \n characters, empty lines, etc. """ """ Also, same file can have same line multiple times, """ """ so remove duplicate lines from the lines array before returning """ modified_lines = lines return modified_lines def main(): file1 = open("one.html", "r") file2 = open("two.html", "r") diff = open("diff.html", "w") lines1 = file1.readlines() lines2 = file2.readlines()