DEV Community

Cover image for 🐍 5 Python Scripts Every Student Dev Should Automate First
Ashan_Dev
Ashan_Dev

Posted on

🐍 5 Python Scripts Every Student Dev Should Automate First

I'm a student dev from Karachi. No internship. No senior to guide me.
Just a laptop, Python, and a habit of automating everything that bored me twice.
Here's what I wish I had automated sooner.


1. 🔁 Auto-Rename & Organize Your Downloads Folder

Your downloads folder is a graveyard. Fix it in 15 lines.

import os
import shutil

FOLDER = os.path.expanduser("~/Downloads")
TYPES = {
    "Images": [".jpg", ".jpeg", ".png", ".gif", ".webp"],
    "Docs":   [".pdf", ".docx", ".txt", ".xlsx"],
    "Code":   [".py", ".js", ".ts", ".html", ".css"],
    "Videos": [".mp4", ".mov", ".mkv"],
    "Zips":   [".zip", ".rar", ".tar"],
}

for file in os.listdir(FOLDER):
    ext = os.path.splitext(file)[1].lower()
    for folder, exts in TYPES.items():
        if ext in exts:
            dest = os.path.join(FOLDER, folder)
            os.makedirs(dest, exist_ok=True)
            shutil.move(os.path.join(FOLDER, file), dest)
Enter fullscreen mode Exit fullscreen mode

Run it once a week with Task Scheduler (Windows) or a cron job. You'll feel like a wizard.


2. 📸 Bulk Screenshot → PDF Converter

Got lecture slides scattered as screenshots? Merge them into one PDF instantly.

from PIL import Image
import os

def screenshots_to_pdf(folder, output="merged.pdf"):
    images = sorted([
        Image.open(os.path.join(folder, f)).convert("RGB")
        for f in os.listdir(folder)
        if f.endswith((".png", ".jpg", ".jpeg"))
    ], key=lambda x: x.filename)

    images[0].save(output, save_all=True, append_images=images[1:])
    print(f"✅ Saved: {output}")

screenshots_to_pdf("./slides")
Enter fullscreen mode Exit fullscreen mode

Install: pip install Pillow

This saved me hours before exams. Seriously.


3. 🔔 Desktop Notifier for Any Website Change

Watching for a job post? A price drop? A new batch opening?
Stop refreshing. Let Python do it.

import requests
import hashlib
import time
from plyer import notification

URL = "https://example.com/jobs"  # replace with your target
CHECK_EVERY = 300  # seconds

def get_hash(url):
    r = requests.get(url, timeout=10)
    return hashlib.md5(r.text.encode()).hexdigest()

last = get_hash(URL)
print("👁️ Watching for changes...")

while True:
    time.sleep(CHECK_EVERY)
    current = get_hash(URL)
    if current != last:
        notification.notify(title="🚨 Page Changed!", message=URL, timeout=10)
        last = current
Enter fullscreen mode Exit fullscreen mode

Install: pip install requests plyer

Set it, forget it, get notified.


4. 📂 Auto-Backup Your Projects to a Zip

Before you break something (you will), back it up.

import zipfile
import os
from datetime import datetime

def backup_project(source_dir, output_dir="./backups"):
    os.makedirs(output_dir, exist_ok=True)
    timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
    zip_name = os.path.join(output_dir, f"backup_{timestamp}.zip")

    with zipfile.ZipFile(zip_name, "w", zipfile.ZIP_DEFLATED) as zf:
        for root, dirs, files in os.walk(source_dir):
            dirs[:] = [d for d in dirs if d not in ["node_modules", ".git", "__pycache__"]]
            for file in files:
                filepath = os.path.join(root, file)
                zf.write(filepath, os.path.relpath(filepath, source_dir))

    print(f"✅ Backup saved: {zip_name}")

backup_project("./my-project")
Enter fullscreen mode Exit fullscreen mode

Notice: it skips node_modules, .git, and __pycache__ — so the zip stays small.


5. 🤖 GitHub Auto-Commit Streak Keeper

Missing a day on your contribution graph hurts.
This script makes a tiny commit so your streak stays alive when life gets in the way.

import subprocess
from datetime import datetime

LOG_FILE = "streak.log"

with open(LOG_FILE, "a") as f:
    f.write(f"streak kept: {datetime.now()}\n")

subprocess.run(["git", "add", LOG_FILE])
subprocess.run(["git", "commit", "-m", f"chore: streak {datetime.now().date()}"])
subprocess.run(["git", "push"])
print("✅ Streak alive!")
Enter fullscreen mode Exit fullscreen mode

Set this on a cron job at 11:50 PM. Sleep peacefully.

⚠️ Use on a personal/practice repo — not your main project.


🎯 Quick Recap

# Script What It Solves
1 Downloads Organizer Chaos in your folders
2 Screenshots → PDF Messy lecture notes
3 Website Change Notifier FOMO on opportunities
4 Project Backup That "oh no" moment
5 Streak Keeper GitHub anxiety

💬 Drop Your Script in the Comments

What's the first thing YOU automated as a student dev?
I'm building a list — your script might end up in part 2. 👇


Built in Karachi. Tested at 2am. Working on more automation tools at github.com/itxashancode

Top comments (0)