Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import os
- key=sys.argv[1]
- arg_path=sys.argv[2]
- option=sys.argv[3]
- def functie(path1):
- list1 = os.listdir(path1)
- for entry in list1:
- full_path = os.path.join(path1,entry)
- if os.path.isdir(full_path):
- functie(full_path)
- else:
- if option == "name":
- if key in entry:
- print(full_path)
- else:
- file = open(full_path,'r')
- filelist = file.read()
- file.close()
- if key in filelist:
- print(full_path)
- functie(os.path.abspath(arg_path))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement