Skip to content

Commit 6803612

Browse files
Clean Up photo directory Added
1 parent 86318b0 commit 6803612

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import os
2+
from os.path import join
3+
for (dirname, dirs, files) in os.walk('.'):
4+
for filename in files:
5+
if filename.endswith('.txt') :
6+
thefile = os.path.join(dirname,filename)
7+
size = os.path.getsize(thefile)
8+
if size == 2578 or size == 2565:
9+
print 'T-Mobile:',thefile
10+
#os.remove(thefile) Add this when you are sure to delete the file
11+
continue
12+
fhand = open(thefile,'r')
13+
lines = list()
14+
for line in fhand:
15+
lines.append(line)
16+
fhand.close()
17+
if len(lines) == 3 and lines[2].startswith('Sent from my iPhone'):
18+
print 'iPhone:', thefile
19+
#os.remove(thefile) Add this when you are sure to delete the file
20+
continue

Clean_Up_Photo_Directory/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
**Clean Up photo directory**
2+
3+
4+
5+
**How to Use:**
6+
This Script is an Clean Up photo directory before that we need to import os Then just we need to run Clean Up_Photo_Directory.py simple and easy to use.
7+
8+
9+
**conclusion:**
10+
11+
This Just a Script That we can allow to clean up photos from the terminal itself!
12+
13+
#### By [Kalivarapubindusree]()

0 commit comments

Comments
 (0)