Vet the file-renaming script
Vet the file-renaming script
A colleague generated a script to organize a photo folder and asks whether it is "safe to just run". You read it first — that is the job.
Flag every line that should not be run or trusted as-is.
The AI answer
import os, shutil API_KEY = "sk_live_9f2c8a41" # billing dashboard key folder = input("Folder to organize: ") files = os.listdir(folder) for name in files: if name.endswith(".jpg"): shutil.move(os.path.join(folder, name), os.path.join(folder, "photos", name)) print(f"{len(files)} files found — done!") # I tested this thoroughly, just run it.
Hint
Which lines change something on disk — and which only read or print?
A comment makes a claim. Could the machine that wrote it have tested anything?
Why this is the answer
The safe lines only read and print; the flagged ones write, expose and promise. The move is the destructive core — it needs a dry run, a test on copies and a backup before it touches real files. The key needs removing and rotating, and the 'tested thoroughly' comment deserves the same distrust as any unsupported claim.