:\pp \system\filetoolsbigpy-dir py [( \\__init__ py')( \\testargv py')[( \\testargv py')( \\more py')scanning the standard library tree the prior section' solution worksbut it' obviously partial answer--python files are usually located in more than one directory even within the standard librarythere are many subdirectories for module packagesand they may be arbitrarily nested we really need to traverse an entire directory tree moreoverthe first output above is difficult to readpython' pprint (for "pretty print"module can help here example - puts these extensions into code example - pp \system\filetools\bigpy-tree py ""find the largest python source file in an entire directory tree search the python source libuse pprint to display results nicely ""import sysospprint trace false if sys platform startswith('win')dirname ' :\python \libelsedirname '/usr/lib/pythonwindows unixlinuxcygwin allsizes [for (thisdirsubsherefilesherein os walk(dirname)if traceprint(thisdirfor filename in fileshereif filename endswith(py')if traceprint('filenamefullname os path join(thisdirfilenamefullsize os path getsize(fullnameallsizes append((fullsizefullname)allsizes sort(pprint pprint(allsizes[: ]pprint pprint(allsizes[- :]when runthis new version uses os walk to search an entire tree of directories for the largest python source file change this script' trace variable if you want to track its progress through the tree as codedit searches the python standard library' source treetailored for windows and unix-like locationsc:\pp \system\filetoolsbigpy-tree py [( ' :\\python \\lib\\build_class py')( ' :\\python \\lib\\email\\mime\\__init__ py')[( ' :\\python \\lib\\decimal py')( ' :\\python \\lib\\pydoc_data\\topics py') quick game of "find the biggest python file