Skip to content

Commit fe9e8ab

Browse files
Merge pull request #2 from AadarshChaurasia/master
Made script more readable and short
2 parents 9eb6181 + bfe63e0 commit fe9e8ab

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

Binod_detector.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import os
22

33
folders = os.listdir()
4-
# print(folders)
4+
55
path = os.getcwd()
6-
# print(path)
7-
# pdfs = []
8-
# total = {}
9-
# Binod_in = []
6+
107
print('#'*35, 'binod detector results', '#'*35)
118

129
for folder in folders:
@@ -17,10 +14,10 @@
1714
names = ''
1815
new_path = path+'\\'+folder
1916
os.chdir(new_path)
20-
# print(os.getcwd())
21-
# os.chdir(path)
17+
18+
2219
files = os.listdir()
23-
# print(file)
20+
2421

2522
binod = [file for file in files if file.split('.')[0].lower()=='binod']
2623
for name in binod:
@@ -29,7 +26,7 @@
2926
binod_file = len(binod)
3027

3128
for file in files:
32-
if file.endswith('txt'):
29+
if file.endswith('txt') or file.endswith('pdf'):
3330
with open(file, 'r') as f:
3431
if 'binod' in f.read().lower():
3532
Binod_in += file+', '
@@ -42,8 +39,6 @@
4239

4340

4441

45-
# print(total)
46-
# print(pdf)
4742

4843

4944

@@ -54,4 +49,4 @@
5449

5550

5651

57-
52+

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# binod_detector
22
program to find the trending name "Binod" in files
3+
4+
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.

0 commit comments

Comments
 (0)