MiaoWoo Tools

30 Lines of Python That Replaced 800 Manual File Renames

By MiaoWoo — an AI-assisted dev service with human verification. Published 2026-09-28.

I keep seeing people rename hundreds of files by hand, merge Excel sheets by copy-paste, and refresh a product page every morning hoping the price dropped. All of that is script work. Here are four scripts I actually run.

1. Batch rename (the painful one)

A designer drops 800 images named untitled-1.jpg, IMG_2837.jpg... and you need product-A-001.jpg. That's 800 presses of F2 — or:

import os

folder = "./images"
prefix = "product-A"

files = sorted([f for f in os.listdir(folder)
                if f.lower().endswith(('.jpg', '.png'))])

for i, f in enumerate(files, 1):
    ext = os.path.splitext(f)[1]
    new_name = f"{prefix}-{i:03d}{ext}"
    os.rename(os.path.join(folder, f), os.path.join(folder, new_name))
    print(f"{f} -> {new_name}")

print(f"Done, {len(files)} files")

Thirty seconds, 800 files, zero typos. Run it on a copy first — os.rename has no undo.

2. Merge a folder of Excel files into one sheet

import pandas as pd
import glob

files = glob.glob("./reports/*.xlsx")
dfs = [pd.read_excel(f) for f in files]

result = pd.concat(dfs, ignore_index=True)
result.to_excel("./merged.xlsx", index=False)

print(f"Merged {len(files)} files, {len(result)} rows")

3. Watch a page and tell me when the price drops

import requests, time
from bs4 import BeautifulSoup

url = "https://example.com/product/123"
target_price = 500
headers = {"User-Agent": "Mozilla/5.0"}

while True:
    r = requests.get(url, headers=headers, timeout=15)
    soup = BeautifulSoup(r.text, "html.parser")
    price = float(soup.select_one(".price").text.strip("¥$"))

    if price <= target_price:
        print(f"Price dropped! Now {price}")
        break

    print(f"Now {price}, waiting for {target_price}")
    time.sleep(3600)

Check the site's terms before scraping, and use the public price — don't log in to a paywalled or captcha-protected page.

4. Daily industry news in your inbox

import feedparser

feed = feedparser.parse("https://example.com/rss")
for entry in feed.entries[:10]:
    print(entry.title, entry.link)

Drop it in a cron job and it runs every morning.

The real problem isn't the code

None of this is hard. What stops people is: not knowing the task can be automated, knowing but having no time, or writing it and losing an afternoon to debugging.

That's the gap I fill: you describe the job (what files, what format, what result), I write the script and run it myself before delivering. You get working code plus a usage guide, and free fixes for 7 days if it doesn't run on your machine. Custom small tools ¥29.9 (~$4); copywriting, resume polishing, spreadsheet cleanup and research tasks from ¥9.9 (~$1.5).

Site: https://miaowoo.900890.xyz

Just want the free stuff?

Fair. There's a list of free tools I've personally installed and tested (not scraped from a "100 best tools" post) — leave your email on the site and it's yours.

Delivered by AI with human verification — that's why it's fast and cheap. Digital goods: no refunds after delivery, but I fix anything that doesn't work, free, for 7 days.

更多实测指南: Excel清洗脚本 · 1小时调研法 · 简历5大错误 · 自建收款站 · 30行Python整理文件 · 免费工具清单(留邮箱即发)· 客服话术模板