Skip to content

Instantly share code, notes, and snippets.

@s-hiiragi
Created August 18, 2012 03:53
Show Gist options
  • Save s-hiiragi/3384244 to your computer and use it in GitHub Desktop.
Save s-hiiragi/3384244 to your computer and use it in GitHub Desktop.
count line
import glob
if __name__ == '__main__':
paths = glob.glob('./*/data/*.csv')
cnt = 0
for path in paths:
with open(path, 'r') as f:
cnt += reduce(lambda x,y: x+1, f, 0)
print cnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment