I created a python program to provide a diff file. Wanted to know what the best way to send the results of the diff into a .csv would be
Here's my code,
import difflib
file1 = "swiss1.csv"
file2 = "swiss2.csv"
diff = difflib.ndiff(open(file1).readlines(),open(file2).readlines())
for line in diff:
if line[0] in ["+", "-"]:
print line
Rather than print to the terminal I would like to print it to a CSV file. Thoughts?