Full time software developer, part time hacker


Pyloc is a Lines Of Code analyser written in Python. Supported languages are configurable. Stats are broken down in to code, comments and whitespace, with Physical SLOC including everything.

Requires Python 2.6+ and WxPython to run the GUI.


Click an image to load the fullsize version.

Adding new languages

To add support for a new language, edit Add a string value representing the language and the definition to the language dictionary:

LUA = "Lua"

    { EXTENSIONS:    [ ".lua" ] ,
      LINECOMMENTS:  "--" ,
      BLOCKCOMMENTS: [ ( "--[[" , "]]" ) ] } }

Where the string represnets the name of the language, and the dictionary entries represent:

  1. EXTENSIONS is a comma seperated list of file extensions.
  2. LINECOMMENTS (optional) is a string representing characters used for line comments.
  3. BLOCKCOMMENTS (optional) is a comma seperated list of pairs of begin and end block comment strings.


Pyloc can either be run as a desktop GUI:


Or as a terminal application by calling directly:

Usage: directory [-v]

Where 'directory' is the directory to scan and -v will cause verbose output.


The source can be found on Github