|
@@ -12,6 +12,8 @@ BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
|
print()
|
|
print()
|
|
files_paths = []
|
|
files_paths = []
|
|
exec_files_paths = [] # уже проверенные
|
|
exec_files_paths = [] # уже проверенные
|
|
|
|
+remove_files_paths = [] # файлы на удаление
|
|
|
|
+
|
|
dirs = os.listdir(BASE_DIR)
|
|
dirs = os.listdir(BASE_DIR)
|
|
for dir in dirs:
|
|
for dir in dirs:
|
|
dir_path = os.path.join(BASE_DIR, dir)
|
|
dir_path = os.path.join(BASE_DIR, dir)
|
|
@@ -70,8 +72,7 @@ for file_1 in tqdm(files_paths):
|
|
out_str += f"{later_file} позже {early_file}\n"
|
|
out_str += f"{later_file} позже {early_file}\n"
|
|
out_str += f"ratio = {ratio}, удален\n"
|
|
out_str += f"ratio = {ratio}, удален\n"
|
|
|
|
|
|
- #удаление файла
|
|
|
|
- os.remove(os.path.join(BASE_DIR, later_file))
|
|
|
|
|
|
+ remove_files_paths.append(os.path.join(BASE_DIR, later_file))
|
|
|
|
|
|
|
|
|
|
exec_files_paths.append(f"{small_filename_1}|{small_filename_2}")
|
|
exec_files_paths.append(f"{small_filename_1}|{small_filename_2}")
|
|
@@ -89,6 +90,10 @@ with open(log_path, "w", encoding="utf-8") as f_log:
|
|
f_log.write(prev_str)
|
|
f_log.write(prev_str)
|
|
f_log.close()
|
|
f_log.close()
|
|
|
|
|
|
|
|
+# удаление файлов
|
|
|
|
+for remove_path in remove_files_paths:
|
|
|
|
+ os.remove(remove_path)
|
|
|
|
+
|
|
|
|
|
|
print("success")
|
|
print("success")
|
|
|
|
|