Skip to content

Commit c845e89

Browse files
authored
Update Main.py
1 parent d1831e0 commit c845e89

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

File_Manager/Main.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313
# check is file or dir
1414
if os.path.isfile(i):
1515
# if equal to script name skip
16-
if i == 'temp.py':
16+
if i == 'Main.py' or i == "File Magager.exe":
1717
continue
1818
# # split file name to catch extension name
1919
false_temp , temp = i.split('.')
2020
# append extension of file to ext_file list
2121
ext_file.append(temp)
2222
# set folder status to 0
2323
created_folder[temp] = 0
24+
else:
25+
list_dir.remove(i)
2426

2527
# create folder for each type
2628
for i in ext_file:
@@ -37,8 +39,9 @@
3739
# move files to each folder
3840
for each in list_dir:
3941
temp = each.split(".")
42+
print(temp)
4043
# if file is create while program run or
4144
# create not folder to file name skip it
4245
if temp[1] not in ext_file:
4346
continue
44-
os.rename(each,f"./{temp[1]}_files/{each}")
47+
os.rename(each,f"./{temp[1]}_files/{each}")

0 commit comments

Comments
 (0)