Last active
August 29, 2015 14:03
-
-
Save nanzono/cd48a8efce5c04a3b2bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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