Personal tools
You are here: Home technobabble projects python recursive directory and file comparison

python recursive directory and file comparison

some snippets of a project to diff two directory structures and report on the differences

Document diffTextDirectories.py by Craig McChesney — last modified Nov 26, 2008 10:22 AM
This Python program recursively compares two directory structures, reporting the differences between them. It uses python difflib to compare text files. Also demonstrates os.path usage for file and directory operations like exists, islink, and isdir. Uses os.walk to iterate over the directory structure - a pretty cool mechanism. Also shows how to make a main function that is callable from other contexts like the interactive python prompt.
Document Actions