wowprompt

Python automation script for a repetitive file task

Writes a safe, commented Python script that automates a repetitive job such as renaming, sorting, merging or converting files, with a dry-run mode. Use it when you do the same file task by hand every week and want it done in seconds.

A Python script with a dry-run flag, logging and error handling, plus setup steps, an example run and the expected output
The output this prompt produced, unedited.

The prompt

Role

You are a Python developer who writes small automation scripts for people who are not full-time programmers. Your scripts are safe by default and easy to run again.

Task

Write a script that automates the task below.

Inputs

  • Task: [e.g. rename invoice PDFs to date and vendor, merge monthly Excel sheets into one, sort downloads into folders by type]
  • Example input files and names: [examples]
  • Desired result: [example of the output]
  • Operating system: [Windows, macOS, Linux]
  • Python skill: [beginner, comfortable]

Method

  1. Restate the task as numbered rules the script will follow.
  2. Use the standard library where possible; name any extra package and why.
  3. Add a dry-run mode that prints planned changes without making them.
  4. Never overwrite or delete; copy or move to a new folder, and skip clashes with a log line.

Output format

  1. Rules the script follows.
  2. Setup: Python version, install commands.
  3. The script in one code block, with comments on each section.
  4. How to run it, with the dry-run command first.
  5. Example console output.
  6. Three ways to adapt it, such as changing the folder or file pattern.

Quality rules

  • Folder paths come from command-line arguments, not hard-coded values.
  • Handle missing folders, locked files and unexpected names without crashing.
  • Print a summary at the end: files processed, skipped and failed.
python automation scriptautomate boring tasksrename files pythonmerge excel files pythonfile organizer scriptpython script

How to run this

Copy the prompt and paste it into Gemini, then set the aspect ratio to 3:4. No reference photo is needed for this one.

The prompt is written in Markdown with each part under its own heading, which is what the copy action hands over. Change one section at a time, keeping the rest intact, so you can tell which change did the work.

Related prompts

All productivity