Skip to content

Commit 375215e

Browse files
authored
Merge pull request #13 from YashAgrawal0/master
New script FileLocator added
2 parents f8f439b + d8fa6d7 commit 375215e

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

FileLocator/code.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import os
2+
from os.path import join
3+
4+
location = str(input("Directory Location : "))
5+
extension = str(input("Extension of files to search for : "))
6+
7+
for (dirname, dirs, files) in os.walk(location):
8+
for filename in files:
9+
if filename.endswith('.'+extension) :
10+
thefile = os.path.join(dirname,filename)
11+
print(os.path.getsize(thefile), thefile)

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,9 @@ Happy scripting!
7979

8080
#### Requirements :
8181
Python 3.5+, pyautogui, smtplib, ssl, email, getpass
82+
83+
### FileLocator :
84+
For given directory location find size and path of all files of a particular extension present in directory (including sub-directories).
85+
86+
#### Requirements :
87+
Python 3.5+

0 commit comments

Comments
 (0)