laziness is the mother of many framework armed with the portable search_all script from example - was able to better pinpoint files to be edited every time changed the book examples tree content or structure at least initiallyin one window ran search_all to pick out suspicious files and edited each along the way by hand in another window pretty soonthoughthis became tedioustoo manually typing filenames into editor commands is no funespecially when the number of files to edit is large since occasionally have better things to do than manually start dozens of text editor sessionsi started looking for way to automatically run an editor on each suspicious file unfortunatelysearch_all simply prints results to the screen although that text could be intercepted with os popen and parsed by another programa more direct approach that spawns edit sessions during the search may be simpler that would require major changes to the tree search script as currently codedthoughand make it useful for just one specific purpose at this pointthree thoughts came to mindredundancy after writing few directory walking utilitiesit became clear that was rewriting the same sort of code over and over again traversals could be even further simplified by wrapping common details for reuse although the os walk tool avoids having to write recursive functionsits model tends to foster redundant operations and code ( directory name joinstracing printsextensibility past experience informed me that it would be better in the long run to add features to general directory searcher as external componentsrather than changing the original script itself because editing files was just one possible extension (what about automating text replacementstoo?) more generalcustomizableand reusable approach seemed the way to go although os walk is straightforward to useits nested loop-based structure doesn' quite lend itself to customization the way class can encapsulation based on past experiencei also knew that it' generally good idea to insulate programs from implementation details as much as possible while os walk hides the details of recursive traversalit still imposes very specific interface on its clientswhich is prone to change over time indeed it has--as 'll explain further at the end of this sectionone of python' tree walkers was removed altogether in xinstantly breaking code that relied upon it it would be better to hide such dependencies behind more neutral interfaceso that clients won' break as our needs change of courseif you've studied python in any depthyou know that all these goals point to using an object-oriented framework for traversals and searching example - is complete system programs