-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove_file.py
More file actions
35 lines (27 loc) · 1.22 KB
/
remove_file.py
File metadata and controls
35 lines (27 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
# MANUAL
####################################################################################
# input_string = input("enter sub_folders need remove file : ")
# dir = "D:\\All\\Cisco CCNA 200-301\\NSTH-Cisco.CCNA.200-301.Exam.Part1\\" + input_string
# arr = os.listdir(dir)
# for i in arr:
# if("it.srt" in i or "th.srt" in i or "pl.srt" in i or "ro.srt" in i or "id.srt" in i):
# os.remove(dir + "\\" + i)
# print()
####################################################################################
# AUTO
####################################################################################
dir = "D:\\All\\Cisco CCNA 200-301\\NSTH-Cisco.CCNA.200-301.Exam.Part1"
arr = os.listdir(dir)
for folders in arr:
sub_dir = dir + "\\" + folders
# print(sub_dir)
arr_1 = os.listdir(sub_dir)
for files in arr_1:
# print(files)
if("it.srt" in files or "th.srt" in files or "pl.srt" in files or "ro.srt" in files or "id.srt" in files):
print(dir + "\\" + folders + "\\" + files)
os.remove(dir + "\\" + folders + "\\" + files)
print()
print("SUCCESS!!!")
####################################################################################