Background utility that auto-sorts files into categorized folders based on extension types.
Tick off requirements as you build to track real-time completion.
Follow this chronological guide to build the project from scratch.
Build the path dictionary map and write sorting actions using shutil.move helpers.
import os
import shutil
from pathlib import Path
EXTENSIONS = {
'Images': ['.jpg', '.jpeg', '.png', '.gif'],
'Documents': ['.pdf', '.docx', '.txt', '.xlsx'],
'Archives': ['.zip', '.tar', '.gz'],
}
def organize_folder(target_dir):
p = Path(target_dir)
for entry in p.iterdir():
if entry.is_file():
ext = entry.suffix.lower()
for category, list_ext in EXTENSIONS.items():
if ext in list_ext:
dest_dir = p / category
dest_dir.mkdir(exist_ok=True)
shutil.move(str(entry), str(dest_dir / entry.name))
print(f"Moved {entry.name} to {category}")Real issues students hit during development and how to troubleshoot them fast.
Continue building your skills with similar projects.
Modern responsive developer portfolio with project showcases, contact form, and dark mode.
Gamified quiz application with timer, score tracking, explanations, and instant result analytics.
Interactive restaurant site with animated menu tabs, gallery, reservations, and mobile-first layout.