-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEXEcutor.py
55 lines (43 loc) · 1.58 KB
/
EXEcutor.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import os
import shutil
import time
def move_exe_files(folder_path):
temp_folder = "exe files bin"
if not os.path.exists(temp_folder):
os.mkdir(temp_folder)
exe_files = []
for root, _, files in os.walk(folder_path):
exe_files.extend([os.path.join(root, file)
for file in files if file.endswith(".exe")])
if not exe_files:
print("No .exe files found in the repository.")
return
print("Found the following .exe files:")
for exe_file in exe_files:
print(f"📁 {exe_file}")
# Progress animation
print("\nMoving .exe files to temp folder ", end="")
for _ in range(5): # Simulate progress with animation
print(".", end="", flush=True)
time.sleep(0.5)
print()
for exe_file in exe_files:
target_path = os.path.join(temp_folder, os.path.basename(exe_file))
shutil.move(exe_file, target_path)
confirmation = input("Do you want to delete the .exe files? (yes/no): ")
if confirmation.lower() == "yes":
print("Deleting files... ", end="")
for _ in range(3): # Simulate progress with animation
print("🗑️", end="", flush=True)
time.sleep(0.8)
print()
deleted_count = 0
for exe_file in os.listdir(temp_folder):
os.remove(os.path.join(temp_folder, exe_file))
deleted_count += 1
print(f"✅ {deleted_count} files deleted.")
else:
print("Files not deleted.")
if __name__ == "__main__":
current_directory = os.getcwd()
move_exe_files(current_directory)