Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- out = 0
- def list_dir(path):
- ignore = [
- '.idea',
- '.git'
- ]
- for file in os.listdir(path):
- full_path = os.path.join(path, file)
- if os.path.isdir(full_path):
- if file not in ignore:
- list_dir(full_path)
- else:
- global out
- out += len(open(full_path, errors='ignore').readlines())
- if __name__ == '__main__':
- list_dir(os.getcwd())
- print(out)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement