visitor filevisitor(trace= visitor run(sys argv[ ]print('visited % files and % dirs(visitor fcountvisitor dcount)if testmask dosearchvisitor searchvisitor(sys argv[ ]trace= visitor run(sys argv[ ]print('found in % filesvisited % (visitor scountvisitor fcount)selftest(int(sys argv[ ]) dolist dosearch this module primarily serves to export classes for external usebut it does something useful when run standalonetoo if you invoke it as script with test mask of and root directory nameit makes and runs filevisitor object and prints an exhaustive listing of every file and directory at and below the rootc:\pp \toolsvisitor py :\temp\pp \examples :\temp\pp \examples = :\temp\pp \examples\readme-root txt :\temp\pp \examples\pp = :\temp\pp \examples\pp \echoenvironment pyw = :\temp\pp \examples\pp \launchbrowser pyw = :\temp\pp \examples\pp \launcher py = :\temp\pp \examples\pp \launcher pyc more output omitted (pipe into more or file = :\temp\pp \examples\pp \system\threads\thread-count py = :\temp\pp \examples\pp \system\threads\thread py :\temp\pp \examples\pp \tempparts = :\temp\pp \examples\pp \tempparts\ jpg = :\temp\pp \examples\pp \tempparts\lawnlake -jan- jpg = :\temp\pp \examples\pp \tempparts\part- txt = :\temp\pp \examples\pp \tempparts\part- html visited files and dirs if you instead invoke this script with as its first command-line argumentit makes and runs searchvisitor object using the third argument as the search key this form is similar to running the search_all py script we met earlierbut it simply reports each matching file without pausingc:\pp \toolsvisitor py :\temp\pp \examples mimetypes :\temp\pp \examples\pp \extras\losalamosadvancedclass\day -system\data txt ha mimetypes :\temp\pp \examples\pp \internet\email\mailtools\mailparser py has mimetypes :\temp\pp \examples\pp \internet\email\mailtools\mailsender py has mimetypes :\temp\pp \examples\pp \internet\ftp\mirror\downloadflat py has mimetypes :\temp\pp \examples\pp \internet\ftp\mirror\downloadflat_modular py has mimet ypes :\temp\pp \examples\pp \internet\ftp\mirror\ftptools py has mimetypes :\temp\pp \examples\pp \internet\ftp\mirror\uploadflat py has mimetypes :\temp\pp \examples\pp \system\media\playfile py has mimetypes found in filesvisited visitorwalking directories "++