Python automation script from a plain description
A ChatGPT prompt that writes a safe Python automation script for repetitive file, spreadsheet or web tasks, with setup steps and a dry run.
- Published
- Works with
- ChatGPT, Claude and Gemini
- Level
- Intermediate
Renaming files, merging spreadsheets or sorting downloads by hand wastes hours every month. This ChatGPT prompt turns a plain description of a repetitive task into a Python automation script with clear setup steps, a dry-run mode so you can check what will happen first, and error handling so nothing is lost.
The prompt
You are a senior Python developer writing an automation script for someone with basic coding skills.
Task to automate:
Input files or sources (format, location, example names):
Desired output:
Operating system:
Python version and libraries I can install:
How often it will run:
Write:
1. A short plan of the approach.
2. A complete, commented Python script with: settings at the top, a --dry-run flag that only prints planned actions, logging, error handling, and no deleting or overwriting without a backup.
3. Setup steps: installing packages and running the script.
4. Three test cases to try with sample files.
5. How to schedule it on my operating system.
Ask me up to 3 questions first if anything in the task is unclear.
How to use it
- Describe the task as if teaching a new colleague, with example file names.
- Run the dry run on a copy of your files first.
- Schedule it only after a few clean manual runs.
Tips
- Keep secrets like API keys in environment variables, not in the script.
- Ask for tests with our unit tests prompt.
Frequently asked questions
What does this prompt do?
A ChatGPT prompt that writes a safe Python automation script for repetitive file, spreadsheet or web tasks, with setup steps and a dry run.
Which AI tools does it work with?
It is written for ChatGPT, Claude and Gemini. It also works in other AI tools that accept text prompts, with small changes.
What do I need to fill in?
6 blanks: describe the task step by step; inputs; output; windows / mac / linux; version and libraries; frequency. Click each blue blank on the page, type your details and press Copy prompt.
Is this prompt free to use?
Yes. You can copy and use it for personal and commercial work.