Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import glob
  2. import os
  3.  
  4. def file_len(fname):
  5. with open(fname) as f:
  6. for i, l in enumerate(f, start = 1):
  7. pass
  8. return i
  9.  
  10. files = glob.glob("/home/seb/Learning/*.txt")
  11. print files
  12.  
  13. length = []
  14.  
  15. for file in files:
  16. file_len(file)
  17. length.append(i)
  18.  
  19. print length
  20.  
  21. length.append(i)
  22.  
  23. for file in files:
  24. lines = file_len(file)
  25. length.append(lines)
  26.  
  27. flength = file_len(file)
  28. length.append(flength)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement