Skip to content

The Power of Scripting - Why Automate?

Automation is writing code that:

  • performs repetitive tasks reliably
  • reduces human error
  • creates repeatable workflows

Good targets:

  • organizing files
  • backups
  • cleaning data
  • generating reports
  • Idempotent when possible (safe to run twice)
  • Has clear inputs/outputs
  • Has logging
  • Has a dry-run mode
make_folders.py
from pathlib import Path
 
 
def ensure_structure(base: Path):
    for name in ["input", "output", "logs"]:
        (base / name).mkdir(parents=True, exist_ok=True)
 
 
ensure_structure(Path("./my_job"))
  • test on a sample folder
  • print actions first
  • keep backups
  • avoid hardcoding absolute delete paths

pch.coffeeTagline

pch.coffeeCta

pch.feedbackHeading

pch.feedbackSubheading