25 lines
703 B
Python
25 lines
703 B
Python
import os
|
|
import shutil
|
|
|
|
ch4F = "./ch4"
|
|
files = os.listdir(ch4F)
|
|
|
|
os.mkdir(f"{ch4F}/TEMPwo0")
|
|
|
|
for sprite in files:
|
|
if ".png" in sprite and sprite and f"{sprite[:-6]}_1.png" in files:
|
|
if "TEMP" not in files:
|
|
os.mkdir(f"{ch4F}/TEMP")
|
|
for finds in files:
|
|
if sprite[:-6] in finds and sprite in files:
|
|
shutil.move(f"{ch4F}/{finds}", f"{ch4F}/TEMP/{finds}")
|
|
os.rename(f"{ch4F}/TEMP", f"{ch4F}/{sprite[:-6]}")
|
|
else:
|
|
shutil.move(f"{ch4F}/{sprite}", f"{ch4F}/TEMPwo0/{sprite}")
|
|
os.rename(f"{ch4F}/TEMPwo0/{sprite}", f"{ch4F}/TEMPwo0/{sprite[:-6]}.png")
|
|
files = os.listdir(ch4F)
|
|
|
|
shutil.move(f"{ch4F}/TEMPwo0", f"{ch4F}")
|
|
os.remove(f"{ch4F}/TEMPwo0")
|
|
|
|
print(files) |