Quick way to calculate lines of code/comments in a collection of Python scripts?

Chris Angelico rosuav at gmail.com
Wed Oct 5 14:08:57 EDT 2016


On Thu, Oct 6, 2016 at 4:56 AM, Malcolm Greene <python at bdurham.com> wrote:
> Looking for a quick way to calculate lines of code/comments in a
> collection of Python scripts. This isn't a LOC per day per developer
> type analysis - I'm looking for a metric to quickly judge the complexity
> of a set of scripts I'm inheriting.

Post the code to GitHub, then click on the file. Up the top, you'll
see something like this:

https://github.com/Rosuav/LetMeKnow/blob/master/letmeknow.py
231 lines (212 sloc)

The first figure is the raw line count. The second is, in theory at
least, the number of lines of "actual code".

Cheating? Totally. Effective? Yup.

ChrisA



More information about the Python-list mailing list