I am trying to compare two directories using the dircmp function in python
def cmpdirs(dir_cmp):
for sub_dcmp in dir_cmp.subdirs.values():
cmpdirs(sub_dcmp)
return dir_cmp.left_only, dir_cmp.right_only, dir_cmp.common_files
if __name__ == '__main__':
dcmp = dircmp('dir1', 'dir2')
result = list(cmpdirs(dcmp))
I am trying to get a result like:
([file1,file2],[file3,file4],[file5,file6])
What is the best way to do this?
returntoyield?