beatrun.ru/build_windows.py

25 lines
638 B
Python
Raw Normal View History

2024-03-17 17:04:07 +05:00
import os
from pathlib import Path
import traceback
paths = []
paired_paths = []
counter = 0
try:
for path in Path('input/').rglob('*'):
counter += 1
path = str(path)
oldext = os.path.splitext(path)[1]
os.rename(path, "shame/" + str(counter) + oldext)
path = "shame/" + str(counter) + oldext
paths.append(str(path).replace("\\", "/"))
except Exception as e:
print(traceback.format_exc())
input()
for i in range(0, len(paths), 2):
if i+1 > len(paths):
paired_paths.append([paths[i]])
else:
paired_paths.append([paths[i], paths[i+1]])
print(paired_paths)