Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import glob
- import os
- def file_len(fname):
- with open(fname) as f:
- for i, l in enumerate(f, start = 1):
- pass
- return i
- files = glob.glob("/home/seb/Learning/*.txt")
- print files
- length = []
- for file in files:
- file_len(file)
- length.append(i)
- print length
- length.append(i)
- for file in files:
- lines = file_len(file)
- length.append(lines)
- flength = file_len(file)
- length.append(flength)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement