new to python, help please !!

Peter Otten __peter__ at web.de
Thu Nov 12 09:56:40 EST 2015


Tim Chase wrote:

>   with open("file1.md5") as a, open("file2.md5") as b:
>     for s1, s2 in zip(a, b):
>       if s1 != s2:
>         print("Files differ")

Note that this will not detect extra lines in one of the files.
I recommend that you use itertools.zip_longest (izip_longest in Python 2) 
instead of the built-in zip().




More information about the Python-list mailing list