PP2E SLOC Counter Scripts

I counted 41,938 source lines of code (SLOC) in the book examples distribution as of November 2001, with the following 4 scripts. Each uses a different directory traversal technique, but returns the same result:

These scripts don't count everything (e.g., they skip makefiles), but are comprehensive enough for ballpark figures. Here's the output for the visitor class version, when run on the root of the book examples tree:

C:\temp>python wcall_visitor.py %X%
...lines deleted...
C:\PP2ndEd\examples\PP2E\Integrate\Mixed\Exports\ClassAndMod\cinterface.py
C:\PP2ndEd\examples\PP2E\Integrate\Mixed\Exports\ClassAndMod\main-table.c
Visited 1478 files and 133 dirs
--------------------------------------------------------------------------------

Files=> 903 Lines=> 41938
{'.c': 46, '.cgi': 24, '.html': 41, '.pyw': 11, '.cxx': 2, '.py': 768, 
 '.i': 3,  '.h': 8}

Back to the PP2E updates page



[Home page] Books Code Blog Python Author Train Find ©M.Lutz