File Compare with difflib.context_diff

JohnV loftmaster at gmail.com
Wed Mar 18 23:41:13 CET 2009


Maybe something like this will work though I am not sure of my quotes
and what to import

import shutil

f = open(r'C:\Users\Owner\Desktop\mydata.txt', 'r')
read_data1 = f.read()
f.close()

shutil.copy('C:\Users\Owner\Desktop\newdata.txt', 'C:\Users\Owner
\Desktop\out.txt')
file = open(r'C:\Users\Owner\Desktop\out.txt', 'w')
file.write(text.replace(read_data1, ""))
file.close()



More information about the Python-list mailing list