The Prompt Library
CodingPython

Python Script Generator

Generate a basic Python script for a task, function, or automation.

Select Model:

Prompt:

I need help creating a Python script for a specific task. Please generate a well-structured, commented Python script based on my requirements. SCRIPT DETAILS: - Purpose: [DESCRIBE THE TASK OR FUNCTION] - Input: [WHAT DATA WILL THE SCRIPT RECEIVE] - Output: [WHAT SHOULD THE SCRIPT PRODUCE] - Required functionality: [SPECIFIC FEATURES NEEDED] - Python version: [VERSION IF SPECIFIC] - Libraries/dependencies: [ANY REQUIRED LIBRARIES] - Execution environment: [WHERE WILL THIS RUN] Please create a Python script that: 1. STRUCTURE & STYLE * Follows PEP 8 style guidelines * Includes proper docstrings and comments * Uses meaningful variable and function names * Implements proper error handling * Is organized into logical functions/classes * Includes a main execution block with if __name__ == "__main__" 2. CORE FUNCTIONALITY * Implements all required features * Handles edge cases and potential errors * Uses efficient algorithms and approaches * Processes inputs correctly * Produces the expected outputs * Includes validation where appropriate 3. CODE QUALITY * Is readable and maintainable * Avoids unnecessary complexity * Uses Python idioms and best practices * Includes appropriate type hints (if using Python 3.6+) * Follows the principle of least surprise 4. DOCUMENTATION * Includes a header explaining the script's purpose * Documents parameters, return values, and exceptions * Provides examples of usage * Explains any complex algorithms or logic * Notes any limitations or assumptions 5. ADDITIONAL CONSIDERATIONS * Performance optimizations where relevant * Security considerations if applicable * Suggestions for future improvements or extensions * Alternative approaches if there are multiple ways to solve Please provide the complete, ready-to-run Python script with all necessary imports and code to accomplish the described task.

Related Prompts

Other prompts you might find useful

CodingPython

Debug Python Error Message

Help diagnose and fix a Python error or traceback.

6 models availableView details
CodingPython

Python Script Generator

Generate a basic Python script for a task, function, or automation.

6 models availableView details
CodingPython

Explain a Python Code Snippet

Break down a piece of Python code and explain what it does in plain English.

6 models availableView details
CodingPython

Refactor Python Code for Clarity

Improve readability and structure of messy or inefficient Python code.

6 models availableView details