dandigit / sloc Goto Github PK
View Code? Open in Web Editor NEWA useful script that finds the total lines of code (LOC) in a directory tree.
License: MIT License
A useful script that finds the total lines of code (LOC) in a directory tree.
License: MIT License
If I use all in a directory that contains png files, It comes up with an error message
"Traceback (most recent call last):
File "sloc.py", line 58, in
totalLines = getTotalLines(getFlags())
File "sloc.py", line 54, in getTotalLines
totalLines += countLinesInFile(os.path.join(root, file))
File "sloc.py", line 38, in countLinesInFile
for i, l in enumerate(file):
File "C:\Users\bpassaportis\AppData\Local\Programs\Python\Python37-32\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 144: character maps to ".
I know you could probably us python-magic to work out whether any given file is plain text. Example Here.
I know I could specify all the file types that I want to, but this could be a problem for someone who has hundreds of different types of files in a directory.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.