>>111246remove the old PNGs that already have JPGs with this python script, name it "move_pngs.py", and run it with "py C:\path\to\move_pngs.py"
import shutil
from pathlib import Path
def main():
print("This script moves all PNGs with equivalently-named JPGs to a subfolder called `trash`.")
while True:
user_input = input("Enter directory path (or 'q' to exit): ").strip()
if user_input.lower() == 'q':
print("Exiting.")
break
target_dir = Path(user_input)
if not target_dir.exists():
print("Error: Path does not exist. Please try again.\n")
continue
if not target_dir.is_dir():
print("Error: Path is not a directory. Please try again.\n")
continue
trash_dir = target_dir / "trash"
trash_dir.mkdir(exist_ok=True) # create trash folder if missing
# Scan for PNG files (caseâinsensitive)
png_files = [f for f in target_dir.iterdir() if f.suffix.lower() == '.png' and f.is_file()]
if not png_files:
print("No PNG files found in the directory.\n")
continue
moved_count = 0
for png_path in png_files:
stem = png_path.stem # filename without extension
# Check for JPG counterpart (caseâinsensitive extension)
jpg_candidates = list(target_dir.glob(f"{stem}.[jJ][pP][gG]"))
if not jpg_candidates:
continue # no matching JPG, skip
# Destination inside trash
dest = trash_dir / png_path.name
if dest.exists():
print(f"Warning: {dest} already exists, skipping {png_path.name}")
continue
shutil.move(str(png_path), str(dest))
print(f"Moved: {png_path.name} -> trash/")
moved_count += 1
print(f"Done. Moved {moved_count} PNG file(s).\n")
if __name__ == "__main__":
main()
>demanding I use your shitty programit's called a script numbnuts