← Back to list

10 Minutes From Now, You’ll Never Do That Manually Again

This morning I had to rename over a thousand files spread across multiple nested folders.

Pradeep Mishra in Variables & Values · 2026-05-25 17:37 · 261 claps · 8.5 min read paywalled
#python #automation #productivity #technology #programming
Open on Medium ↗
Wiki topics: 💻 · Programming ⏱️ · Productivity

10 Minutes From Now, You’ll Never Do That Manually Again

This morning I had to rename over a thousand files spread across multiple nested folders.

I wrote a Python script. It was done in 10 minutes. I made a coffee.

And then I just sat there thinking: if I didn’t know how to do that, I’d still be at it. Four hours in, clicking and typing, doing the same thing over and over, getting more frustrated with every folder. Maybe five hours. Maybe more.

That thought wouldn’t leave me alone.

Because that person exists. Maybe that person is you. You’re smart, you’re capable, you’re good at your job, and yet somewhere in your week there is a task that eats your time alive simply because no one showed you a better way.

This article is that better way.

Every day, across every industry and timezone, people are doing the same things over and over with their own two hands. Renaming files. Sorting folders. Sending templated emails. Scraping data from websites. Generating PDFs. Resizing images. It feels productive because your hands are moving and stuff is getting done. But here’s what changes when you automate it:

If you did it the same way last Tuesday, a computer can do it for you every Tuesday from now on, while you sleep.

I wrote this for the tech lead who wants to reclaim hours each week, yes. But also for the retired teacher managing a photo archive, the student drowning in assignment folders, the small business owner sending the same invoice email fifteen times a month. This one is for all of you.

We’re using Python. Not because it’s the only way, but because it’s the friendliest entry point into automation that exists today. You won’t be studying it. You’ll be using it. There’s a difference, and it matters.

Before Anything Else: Getting Python on Your Machine

Think of Python as the kitchen. Before you cook anything, you need a kitchen. The good news? This one installs in five minutes and costs nothing.

  1. Head to python.org in your browser. Hit the big yellow Download button. Run the installer. On Windows, tick “Add Python to PATH” (that checkbox matters more than it looks).
  2. Open your terminal. Mac/Linux: search “Terminal” in Spotlight or your apps. Windows: search “PowerShell”. These are your command lines, the place where things actually happen.
  3. Type python --version and hit Enter. If you see something like Python 3.12.x, you're set. If you see an error, reinstall and make sure PATH is ticked.
  4. Create a virtual environment, a sealed sandbox for your project’s tools. Type python -m venv myenv on your command line and press Enter. Then activate it: Mac/Linux: source myenv/bin/activate / Windows: myenv\Scripts\activate.
  5. Your prompt now shows (myenv) at the start. That means you're in. Everything you install from here stays tidy, isolated, and won't break anything else on your machine.

Open any text editor. Sublime Text, Notepad++, VS Code, even plain Notepad works fine. Write a script, save it as something.py, and run it with python something.py. That's the entire workflow. Everything else is just what you put inside the file.

What We’ll Automate: Eight Things You’ll Never Do Manually Again

Here’s everything we’re covering. Each one is a self-contained script you can copy, tweak, and run today. No prior knowledge assumed. Comments in the code walk you through what every line does.

Chapter 1: Automating File Management

Let me paint you a picture. You have a Downloads folder. It has 847 items in it. PDFs from two years ago. Images you’ve forgotten about. Some zip files with cryptic names. You know you should sort it. You just never do.

Here’s a Python script that does it for you, instantly, correctly, every time.

Sorting files by their type

This script scans any folder you point it at, reads each file’s extension, and moves it into a subfolder named after that extension. All your .pdf files end up in a pdf/ folder. All your .jpg files in a jpg/ folder. And so on. It takes about 0.3 seconds to run on a folder with hundreds of files.

# Sort every file in a folder into subfolders by extension
import os
from shutil import move

def sort_files(directory_path):
    for filename in os.listdir(directory_path):
        full_path = os.path.join(directory_path, filename)
        # Skip folders, we only want files
        if not os.path.isfile(full_path):
            continue
        # Grab the extension (everything after the last dot)
        file_extension = filename.split('.')[-1].lower()
        destination = os.path.join(directory_path, file_extension)
        # Create the subfolder if it doesn't exist yet
        if not os.path.exists(destination):
            os.makedirs(destination)
        # Move the file into its new home
        move(full_path, os.path.join(destination, filename))
        print(f"Moved: {filename} -> {file_extension}/")
# Change this path to YOUR folder

sort_files("/Users/yourname/Downloads")

Once you’ve saved this script as a .py file anywhere on your system, open your terminal or PowerShell, and run it like this: python /path/to/your/sort_files.py — replace the path with wherever you actually saved it. Note: For all the scripts below, follow the same steps, save the file with a .py extension and run it from your terminal the same way.

Removing empty folders

After sorting, or just over time, folders accumulate ghost directories, empty husks left behind from old projects. This kills them all in one sweep.

import os

def remove_empty_folders(path):
    for dirpath, dirnames, files in os.walk(path, topdown=False):
        if not dirnames and not files:
            os.rmdir(dirpath)
            print(f"Deleted empty folder: {dirpath}")

remove_empty_folders("/Users/yourname/Documents")

Renaming multiple files at once

Got 200 product photos named IMG_4521.jpg through IMG_4721.jpg? This renames them to something meaningful, like product_001.jpg, in about two seconds flat.

import os

def bulk_rename(folder, prefix="file"):
    files = [f for f in os.listdir(folder) if os.path.isfile(os.path.join(folder, f))]
    for i, filename in enumerate(sorted(files), start=1):
        ext = filename.split('.')[-1]
        new_name = f"{prefix}_{i:03d}.{ext}"
        os.rename(
            os.path.join(folder, filename),
            os.path.join(folder, new_name)
        )
        print(f"{filename}  ->  {new_name}")

bulk_rename("/Users/yourname/Photos", prefix="product")

Pro tip: Before running any file-moving script for the first time, add a dry run. Replace the move() or rename() call with a print() first to preview what would happen, without actually doing it. Trust, then automate.

Chapter 2: Automating Emails

You know that email you send every Monday with the weekly summary? Or the birthday greeting you have to remember to send to clients? Or the “your invoice is attached” message you copy-paste fifty times a month? Python’s smtplib module was built for exactly this.

import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

def send_email(to, subject, body):
    sender   = "you@gmail.com"
    password = "your-app-password"  # Use Gmail App Password, not your main one
    msg = MIMEMultipart()
    msg['From']    = sender
    msg['To']      = to
    msg['Subject'] = subject
    msg.attach(MIMEText(body, 'plain'))
    with smtplib.SMTP_SSL('smtp.gmail.com', 465) as server:
        server.login(sender, password)
        server.sendmail(sender, to, msg.as_string())
        print(f"Email sent to {to} ✓")
recipients = [
    ("client1@example.com", "Aarav"),
    ("client2@example.com", "Priya"),
]
for email, name in recipients:
    send_email(email, "Your weekly report is ready", f"Hi {name}, here's your update...")

Pair this with a scheduler, like cron on Mac/Linux or Task Scheduler on Windows, and it fires itself every Monday morning without you touching a thing.

Chapter 3: Automating Excel Spreadsheets

If you or someone you know still manually types data into Excel rows, this is the chapter that will change things. The openpyxl library lets Python write directly into .xlsx files. You give it data; it handles everything else.

import openpyxl
from openpyxl.styles import Font

wb = openpyxl.Workbook()
ws = wb.active
ws.title = "Monthly Sales"
# Write headers with bold styling
headers = ["Product", "Units Sold", "Revenue (Rs.)"]
for col, header in enumerate(headers, start=1):
    cell = ws.cell(row=1, column=col, value=header)
    cell.font = Font(bold=True)
data = [
    ("Widget A", 142, 71000),
    ("Widget B", 89,  44500),
    ("Widget C", 210, 105000),
]
for row in data:
    ws.append(row)
wb.save("monthly_sales.xlsx")
print("Report saved ✓")

First time using openpyxl? Install it with: pip install openpyxl in your activated virtual environment. The same applies to any library below, pip install <name> gets you there.

Chapter 4: Automating Image Editing

Got 300 product photos that need to be resized to 800x800 for your online store? Or you want to stamp your logo on every image before publishing? The Pillow library handles this with barely a dozen lines.

from PIL import Image
import os

def batch_resize(folder, size=(800, 800)):
    output = os.path.join(folder, "resized")
    os.makedirs(output, exist_ok=True)
    for filename in os.listdir(folder):
        if filename.endswith((".jpg", ".jpeg", ".png")):
            img = Image.open(os.path.join(folder, filename))
            img = img.resize(size, Image.LANCZOS)
            img.save(os.path.join(output, filename))
            print(f"Resized: {filename}")

batch_resize("/Users/yourname/ProductPhotos")

Install it with pip install Pillow. The resized copies land in a new resized/ subfolder inside your original directory, so your source files are never touched.

Chapter 5: The Web Scraper for Daily Reports

Every morning, someone somewhere opens five browser tabs, news, stock prices, sports scores, job listings, and manually copies information into a document. There’s a better way. Python’s requests and BeautifulSoup can fetch and parse any public webpage on the internet.

import requests
from bs4 import BeautifulSoup
from datetime import date

def fetch_headlines(url):
    response = requests.get(url, headers={"User-Agent": "Mozilla/5.0"})
    soup = BeautifulSoup(response.text, "html.parser")
    headlines = soup.find_all("h2", limit=10)
    return [h.get_text(strip=True) for h in headlines]
today     = date.today()
report    = f"daily_report_{today}.txt"
headlines = fetch_headlines("https://news.ycombinator.com")
with open(report, "w") as f:
    f.write(f"Daily Report - {today}\n{'='*40}\n\n")
    for i, headline in enumerate(headlines, 1):
        f.write(f"{i}. {headline}\n")
print(f"Report saved: {report}")

Schedule this with cron to run at 7 AM. Your morning report appears in a folder before you've even had coffee. Extend it to scrape job boards, commodity prices, cricket scores, anything publicly available on the web.

Chapter 6: Automating Text Processing

Text files, logs, CSVs, config files. If your work involves any of these, Python can search, replace, clean, and transform them in bulk. Here’s a script that finds every instance of a phrase across an entire folder of .txt files and replaces it.

import os

def bulk_find_replace(folder, find, replace):
    for filename in os.listdir(folder):
        if filename.endswith(".txt"):
            filepath = os.path.join(folder, filename)
            with open(filepath, "r", encoding="utf-8") as f:
                content = f.read()
            if find in content:
                updated = content.replace(find, replace)
                with open(filepath, "w", encoding="utf-8") as f:
                    f.write(updated)
                print(f"Updated: {filename}")

bulk_find_replace("/Users/yourname/Reports", "Q3 2023", "Q3 2024")

Useful for updating company names after a rebrand, correcting a recurring typo across hundreds of files, swapping out placeholder text in document templates, or sanitising exported data before sharing it.

Chapter 7: Automating PDF Operations

PDFs are everywhere and, until recently, largely untouchable by automation. The pypdf library changes that. You can merge multiple PDFs into one, split a single PDF into separate pages, or extract specific pages for a custom report.

from pypdf import PdfWriter, PdfReader

def merge_pdfs(file_list, output_name):
    writer = PdfWriter()
    for filepath in file_list:
        reader = PdfReader(filepath)
        for page in reader.pages:
            writer.add_page(page)
    with open(output_name, "wb") as f:
        writer.write(f)
    print(f"Merged PDF saved: {output_name}")

merge_pdfs(
    ["january.pdf", "february.pdf", "march.pdf"],
    "Q1_report.pdf"
)

Install with pip install pypdf. Useful for combining monthly reports into a single quarterly file, extracting specific pages from large documents, or automating the assembly of client deliverables.

Chapter 8: Automating System Tasks

Your computer has a lot going on beneath the surface, and Python can tap into it. Monitor disk space before it runs out, log running processes, or schedule a cleanup job that fires automatically. Here’s a script that checks your disk and sends a warning if space drops below a threshold.

import shutil

def check_disk_space(path="/", threshold_gb=10):
    total, used, free = shutil.disk_usage(path)
    free_gb = free // (2**30)
    print(f"Free space: {free_gb} GB")
    if free_gb < threshold_gb:
        print(f"Warning: Only {free_gb} GB remaining. Time to clean up.")
    else:
        print("Disk space looks healthy.")

check_disk_space("/")

Pair this with the email script from Chapter 2 and you have a monitoring system that notifies you automatically when something needs attention. No third-party tools, no subscriptions, just Python.

And That’s the Point: You Don’t Have to Be Technical to Use Technical Things

Every script in this article is a tool. You don’t need to understand every line to use a hammer, you just need to know which nail you’re hitting. The same is true here. Copy the code, change the path or the email address or the folder name, and run it. That’s all.

The most dangerous phrase in any language is: “I’ll do it manually, it only takes a minute.” Because it takes a minute, every single time, for the rest of your life.

The eight chapters we covered are the starting line. Text processing, PDF operations, system tasks, they all follow the exact same pattern. A library exists. You install it. You call the right functions. The computer does the rest.

Python has been around since 1991. In that time, someone has built a library for nearly every boring thing imaginable. Your job is just to connect the dots.

I’m here if you hit a wall. Drop a comment, reach out, ask the question. No question is too basic. The only bad question is the one that keeps you stuck.


메타데이터
post_id
dabfb6579d33
slug
10-minutes-from-now-youll-never-do-that-manually-again-dabfb6579d33
url
https://medium.com/variables-values/10-minutes-from-now-youll-never-do-that-manually-again-dabfb6579d33
canonical_url
https://medium.com/variables-values/10-minutes-from-now-youll-never-do-that-manually-again-dabfb6579d33
author_url
https://medium.com/@ppp.mishra124
status
ok
fetched_at
2026-06-13 16:00:06