"Explore the shift from 'Vibe Coding' to Agentic Coding. Compare CrewAI and LangGraph for autonomous software development and learn why deterministic pipelines still win in 2026."
Have you ever downloaded 200 photos from your phone and found them all named "IMG_001", "IMG_002", "IMG_003"? It's messy, unprofessional, and a nightmare if you need to find one specific file later. Doing this manually in Windows Explorer or Mac Finder would take you 2-3 hours. You'd have to click, rename, press enter, repeat... 200 times.
But with Python, you can rename all 200 files in 10 seconds with 12 lines of code. I'm Rehab, an AI and Python developer. I use this exact script every week to organize client projects. Today I'll give you the code for free.
Section 1: The Problem With Manual File Management
Most people don't realize how much time they waste on repetitive computer tasks. Let's say you have a folder with 500 screenshots from a client project. The manual method is prone to human error and extreme fatigue.
My Personal Nightmare
Last year a client sent me 1,200 product photos for their Shopify store. All named "IMG". My deadline was 24 hours. I started renaming manually. After 30 minutes and 40 files, my wrist hurt and I made 3 mistakes. I had to start over.
That night I googled "how to rename many files at once" and found Python. The Python method, however, operates at machine speed with zero mistakes. This isn't just about saving time; it's about shifting your mindset from a "manual operator" to a "process architect."
Section 2: What You'll Learn in This Tutorial
By the end of this post, you'll have a working Python script that can:
- Rename unlimited files automatically across subdirectories.
- Add custom prefixes based on date or project name like "2026_ClientA_001.jpg"
- Handle sequential numbering with zero-padding (001, 002). So it sorts correctly.
- Filter specific file extensions to protect your system files. No risk of renaming.dll or.exe
- Operate cross-platform (Windows, Mac, Linux). Same code works everywhere.
Section 3: The Complete Python Script
Copy this code into any text editor and save it as `rename_files.py`. Don't worry if you've never coded before. I'll explain every line.
import os
import datetime
# ===== SETTINGS - CHANGE THESE TWO LINES =====
folder_path = "C:/Users/YourName/Downloads/Project"
new_name = "Client_Project"
# =============================================
count = 1
today = datetime.date.today()
print("Starting rename process...")
for filename in os.listdir(folder_path):
# Only rename image files
if filename.lower().endswith((".jpg", ".jpeg", ".png", ".heic", ".webp")):
file_extension = os.path.splitext(filename)[1]
# This creates names like: Client_Project_2026-08-02_001.jpg
new_filename = f"{new_name}_{today}_{count:03d}{file_extension}"
old_path = os.path.join(folder_path, filename)
new_path = os.path.join(folder_path, new_filename)
os.rename(old_path, new_path)
print(f"Renamed: {filename} -> {new_filename}")
count += 1
print(f"Done! {count-1} files renamed.")
How To Run It - Step by Step
- Install Python: Go to python.org and download it. Check "Add Python to PATH"
- Change the folder_path: Right click your folder > Properties > Copy the path
- Change new_name: Put your project name here
- Open Terminal/CMD: Type `cd` and paste your folder path. Then type `python rename_files.py`
Section 4: Why Companies Pay for This Skill
This is the core of Process Automation. Marketing agencies and e-commerce stores pay significant fees for people who can bridge the gap between "messy data" and "organized systems."
3 Ways I Make Money With This
1. Client Onboarding: I charge $50 to organize a client's Google Drive with this script + a few extras. Takes me 15 minutes.
2. Content Creators: YouTubers have 10,000 clips named "video1". I sort them by date and topic for $100.
3. Scaling the Logic: You can scale this logic to: Sorting bulk downloads by date. Automated batch conversion of formats. Organizing backups into cloud-synced folders.
Section 5: The "Agentic" Shift - What's Next
While this script is a great start, the future of coding is Agentic. In 2026, we don't just run static scripts; we use autonomous agents that monitor folders for new files and run these scripts automatically.
Example of an Agentic Version
Imagine this: You drop photos into a folder called "To Sort". An AI agent watches it. The second you add files, it renames them, sorts them into "2026/08/August", and sends you a Telegram message: "200 files organized".
If you are interested in moving from "static scripts" to "autonomous agents," this logic is the foundation. You need to understand the loop first before you can make it smart.
Section 6: Important Safety and Troubleshooting
I learned these the hard way. Please don't skip this.
The Golden Rules
- Always Backup: Duplicate the target folder before running any script. I keep a folder called "BACKUP_OLD" just in case.
- The "Test-First" Rule: Create a folder with 5 dummy files to verify logic. Don't test on 2000 files.
Common Errors and Fixes
| Error | What It Means | The Fix |
|---|---|---|
| FileNotFoundError | Python can't find your folder | Check your path. Use double \\ on Windows |
| Permission Denied | Another program is using the files | Close Photos app or Explorer. Run as Administrator |
| Files not renaming | Wrong file extension in the code | Add.mp4 or.pdf to the list in the code |
Section 7: Personal Experience - Why Automation Changed My Workflow
In my own journey as an AI and Python developer, I used to treat coding as a way to build "big apps." It wasn't until I started automating my own "boring" files that I realized the true power of Python.
The Weekend That Broke Me
I once spent an entire weekend manually sorting through 1,000+ files for a client project—an error-prone task that left me exhausted. By Sunday night I was crying and my eyes hurt. I delivered it late and the client was mad.
By Monday, I had written this script, and it finished the job in under 20 seconds. That moment changed my perspective: automation isn't just about saving time; it's about reclaiming your mental energy for the creative work that actually matters.
If You Are Just Starting Out
Don't aim to build the next Facebook. Aim to automate one annoying task this week. That win will give you confidence. This script was my first win. Now I automate emails, invoices, and reports.
Section 8: Final Thoughts
You don't need to be a software engineer to automate your life. Save this post, run the code, and reclaim your time. The 2 hours you save today can be used to learn the next automation, or just to rest.
Question for you
What other boring computer task do you repeat every week? Tell me in the comments, and I'll turn it into a free Python script for you. Last week someone asked for "download all images from a website" and I made it for them.
Let me know what you're struggling with. We're building these tools together.

