[root@www difflib]# vim diff_more_file.py
!/usr/bin/env python
import filecmp
test1 =raw_input("please input you test1 An absolute path : ")
test2 =raw_input("please input you test2 An absolute path : ")
file1 = raw_input("please input you want contrast file: ")
file2 = raw_input("please input you want contrast file: ")
files=[file1,file2]
contrast = filecmp.cmpfiles(test1,test2,files)
print contrast
测试:
[root@www difflib]# python diff_more_file.py
please input you test1 An absolute path : dir1/
please input you test2 An absolute path : dir2/
please input you want contrast file: diff.html
please input you want contrast file: diff.htmlv2
(['diff.html', 'diff.htmlv2'], [], []) #匹配 、不匹配 、错误。
[root@www difflib]#