Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- import os
- PATH = "/usr/share"
- counter = 0
- for path, dirs, files in os.walk(PATH):
- for filename in files:
- fullpath = os.path.join(path, filename)
- try:
- with open(fullpath, 'r') as f:
- for line in f:
- if "sublime" in line:
- print f
- counter += 1
- except IOError:
- continue
- print counter
Add Comment
Please, Sign In to add comment