Python Script Outline to Automate a Simple Business Task
Prompt
Provide an outline for a Python script that automates [describe the simple business task]. Break the solution down into key steps or functions needed to accomplish the task, and mention any important libraries or modules that could be used. If possible, offer both a basic approach (for simplicity) and an advanced approach (for greater efficiency or robustness) to implement this automation.
How to Use
- Define Your Inputs: Clearly describe the business task you want to automate with Python. Include details such as what the input is (e.g., an Excel file, emails to parse, data from a website), what processing needs to happen, and what the expected output is. For example: “Every week I export a CSV of customer orders, filter out cancelled orders, and email a summary report”. Define any success criteria (e.g., the script should run in under 5 minutes, or should handle up to 10,000 records).
- Customize the Prompt: Fill in the prompt template with your task details. Be specific about the task and any constraints or preferences. For instance, if you know certain tools are available, you might add “you can assume I have Excel and an email server available” or if you prefer not to use certain libraries, note that. You can also indicate your skill level (e.g., “I’m a beginner, so use simple techniques” or “advanced solutions using pandas are welcome”).
- Optional Add-ons: If you want the AI to present multiple solutions by complexity, ensure the prompt explicitly asks for both basic and advanced approaches (as it already does). You could also request pseudocode or example code snippets for clarity. Additionally, if scheduling or deployment is a concern, ask for notes on how to run this script automatically (like using Windows Task Scheduler or CRON).
- Run the Prompt: Execute the prompt in your AI tool. The AI will produce an outline of the Python script, usually enumerating the major steps or components (e.g., “1. Import libraries, 2. Load data from CSV, 3. Process data (filter, aggregate...), 4. Generate summary, 5. Send email with results”). If the prompt was followed, you may also get two approaches – one simpler and one more advanced – in the response.
- Review & Select: Review the outlined steps. Check that the flow makes sense for your task and that any suggested libraries (like
pandas for data handling or smtplib for sending email) are appropriate. If the AI provided both basic and advanced approaches, decide which fits your needs and comfort level. You can ask follow-up prompts to flesh out the outline into actual code for the approach you choose, or clarify any steps that are unclear.
- Expected Outcome: You will receive a structured game plan for coding the automation. This typically includes a list of steps or modules for the Python script and notes on which libraries or functions to use. Often, the outline will highlight a straightforward method (easy to implement, maybe more manual or step-by-step) and a more advanced method (perhaps using more powerful libraries or techniques for efficiency). With this outline, you can proceed to write the Python script confidently or even have the AI expand it into actual code, saving you the time of figuring out the structure from scratch.