Home / Prompts / Life / Python automation script

Python automation script

Rename files in bulk, sort photos, merge spreadsheets... describe the chore and get a script that does it in one go.

The prompt is put together in your browser. Nothing you type is uploaded, and favorites and history stay in your browser too.

Good for

  • Sorting thousands of photos into folders by date
  • Merging several spreadsheets into one every month
  • Renaming a whole folder of files to one format

1. Fill in the details

2. Adjust the options

A filled-in example

Fill it in like this. Press the button below to put the example into the form above.

What to automate
Sort the photos in my Downloads folder into year-month folders by date taken, e.g. 2026-10
Operating system
Windows
What the files or data look like
A mix of JPG and PNG, about 3,000 files
Your experience
I have never written code

What the AI's answer looks like

Illustrative excerpt: the real answer depends on the AI you use and what you fill in.

```python
from pathlib import Path
from datetime import datetime
import shutil

SOURCE = Path.home() / "Downloads"   # folder to tidy up
DRY_RUN = True                       # dry run: only list what would happen, move nothing

for photo in SOURCE.glob("*"):
    if photo.suffix.lower() not in {".jpg", ".jpeg", ".png"}:
        continue
    taken = datetime.fromtimestamp(photo.stat().st_mtime)
    target = SOURCE / taken.strftime("%Y-%m")
    print(f"{photo.name} -> {target.name}/")
    if not DRY_RUN:
        target.mkdir(exist_ok=True)
        shutil.move(str(photo), target / photo.name)
```

How to run it (Windows)
1. Download and install Python from python.org and tick "Add Python to PATH"
2. Save the code as sort_photos.py
3. ...

When the list looks right, change DRY_RUN to False and run it again.

Tips

  • Back up the folder or use the dry run before the first real run
  • Describe the files (type, how many, where) so the script gets it right
  • If it fails, paste the full error back or use the "Fix my code" template

How to use it

  1. Fill in the fields. You can leave a field empty for now; the prompt will show a [Please add] placeholder.
  2. Choose the tone, length and where you will paste it, then press Copy.
  3. Paste it into ChatGPT, Claude, Gemini, DeepSeek or a local model. If the AI asks you questions, answer them and the result gets better.

Related prompts

Single-file web app

No coding needed: describe the tool you want and get one HTML file that works when you open it.

Fix my code

Paste your code and the error message to get the cause, a fixed version and how to avoid it next time.

← Back to AI prompts for everyday life