![]() import filecmpĬompare two directories recursively. In the implementation below, when comparing files with the same name, we're always comparing only their contents. However, it does not recurse simply by using common_dirs and subdirs attributes since in that case we would be implicitly using the default "shallow" implementation of files comparison, which is probably not what you want. It uses a recursion instead of os.walk, so it is a little simpler. ![]() ![]() Here's an alternative implementation of the comparison function with filecmp module. ![]()
0 Comments
Leave a Reply. |