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

John Strick jstrickler at gmail.com
Thu Oct 20 17:50:00 EDT 2016


On Wednesday, October 5, 2016 at 12:57:14 PM UTC-5, Malcolm Greene 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.
> 
> Thank you,
> Malcolm

pylint will report on lines of code, comments, blank lines, # of modules, functions, etc. It will also report long lines, non-standard object names, etc. I think it will answer some of your questions. 

https://www.pylint.org/

Just install and use:

     pylint *.py


Regards,
John



More information about the Python-list mailing list