Python Prompts Free Prompt

Python Automation Script for File Organization

Write a Python script to organize files in a directory by type
☆ Save
Prompt
You are a Python automation expert. Write a script that organizes files in a given directory into subfolders based on file type (e.g., Images, Documents, Videos, Music, Archives). The script must: 1) Take a directory path as input, 2) Create subfolders if they don't exist, 3) Move files with appropriate extensions to corresponding folders, 4) Handle duplicate filenames by renaming or skipping, 5) Log all actions to a file, 6) Provide a dry-run option to preview changes, 7) Include a configuration file to customize file type mappings. Add error handling and comments.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.