diff --git a/Binod_detector.py b/Binod_detector.py index ca7340d..0aa67d0 100644 --- a/Binod_detector.py +++ b/Binod_detector.py @@ -1,12 +1,9 @@ import os folders = os.listdir() -# print(folders) + path = os.getcwd() -# print(path) -# pdfs = [] -# total = {} -# Binod_in = [] + print('#'*35, 'binod detector results', '#'*35) for folder in folders: @@ -17,10 +14,10 @@ names = '' new_path = path+'\\'+folder os.chdir(new_path) - # print(os.getcwd()) - # os.chdir(path) + + files = os.listdir() - # print(file) + binod = [file for file in files if file.split('.')[0].lower()=='binod'] for name in binod: @@ -29,7 +26,7 @@ binod_file = len(binod) for file in files: - if file.endswith('txt'): + if file.endswith('txt') or file.endswith('pdf'): with open(file, 'r') as f: if 'binod' in f.read().lower(): Binod_in += file+', ' @@ -42,8 +39,6 @@ -# print(total) -# print(pdf) @@ -54,4 +49,4 @@ - \ No newline at end of file + diff --git a/README.md b/README.md index a80aa03..7c3e46e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # binod_detector program to find the trending name "Binod" in files + +Run thisis script outside of folder in which binod is hidden. This script will tell you how many files have name "binod" and how many filrs have "binod" name hidden inside them.