edit the files or run the file-comparison command on the host platform ( fc on windows/dosdiff or cmp on unix and linuxthat' not portable solution for this last stepbut for my purposesjust finding the differences in , -file tree was much more critical than reporting which lines differ in files flagged in the report of coursesince we can always run shell commands in pythonthis last step could be automated by spawning diff or fc command with os popen as differences are encountered (or after the traversalby scanning the report summarythe output of these system calls could be displayed verbatimor parsed for relevant parts we also might try to do bit better here by opening true text files in text mode to ignore line-terminator differences caused by transferring across platformsbut it' not clear that such differences should be ignored (what if the caller wants to know whether lineend markers have been changed?for exampleafter downloading website with an ftp script we'll meet in the diffall script detected discrepancy between the local copy of file and the one at the remote server to probe furtheri simply ran some interactive python codea open('lp -updates html''rb'read( open( ' :\mark\website\public_html\lp -updates html''rb'read( = false this verifies that there really is binary difference in the downloaded and local versions of the fileto see whether it' because unix or dos line end snuck into the filetry again in text mode so that line ends are all mapped to the standard \ charactera open('lp -updates html'' 'read( open( ' :\mark\website\public_html\lp -updates html'' 'read( = true sure enoughnowto find where the difference isthe following code checks character by character until the first mismatch is found (in binary modeso we retain the difference) open('lp -updates html''rb'read( open( ' :\mark\website\public_html\lp -updates html''rb'read(for ( (acbc)in enumerate(zip(ab))if ac !bcprint(irepr(ac)repr(bc)break '\ '\nthis means that at byte offset , there is \ in the downloaded filebut \ in the local copy this line has dos line end in one and unix line end in the other to see moreprint text around the mismatch complete system programs