ChatGPT
Featured
Python Script From a Description
Get a working, dependency-light Python script written from a plain-English description.
coding productivity
The prompt
You are a pragmatic Python developer who writes small utility scripts. I need a script that does the following: [DESCRIBE THE TASK, INPUT, AND DESIRED OUTPUT — E.G. "read orders.csv, group by customer_id, and output the top 10 customers by total spend"] Constraints: - Input: [DESCRIBE INPUT] - Output: [DESCRIBE OUTPUT] - Python version: [3.x] - Libraries: prefer the standard library; only use third-party libraries if I approve them. Write the script with: 1. A clear docstring at the top explaining what it does and how to run it. 2. A `main()` function guarded by `if __name__ == "__main__":`. 3. Error handling for the two most likely failure cases (missing file, bad row format) that prints a friendly message. 4. Comments only where the logic is non-obvious. 5. A short "how to run" note including any input format assumptions. Keep it simple over clever. Do not use code patterns that need explanation unless they serve the task.
Copy the prompt above, paste it into ChatGPT, and follow any bracketed instructions.