Skip to content

Instantly share code, notes, and snippets.

@nanzono
Last active August 29, 2015 14:03
Show Gist options
  • Save nanzono/cd48a8efce5c04a3b2bc to your computer and use it in GitHub Desktop.
Save nanzono/cd48a8efce5c04a3b2bc to your computer and use it in GitHub Desktop.
# coding:utf-8
import os
target_path = './target/'
def main():
for dpath,dnames,fnames in os.walk(target_path):
for fname in fnames:
if fname == ".DS_Store":
continue
file_path = os.path.join(dpath, fname)
rowcnt = sum(1 for line in open(file_path, "rb"))
print file_path, rowcnt
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment