Data & Automation Lesson 2 of 4

Writing Scripts to Automate File & OS Tasks

24:30 Python for Automation & Data Analysis

Never manually organize folders again. Write a Python script to sort hundreds of downloads, rename files, and batch process PDFs.

Lesson notes

If you do any repetitive task on a computer more than three times a week, a 20-line Python script can do it for you in 2 seconds.

What you'll learn

  • Using Python's built-in pathlib and os libraries
  • Batch renaming files based on date and pattern matching
  • Automating daily tasks with scheduled cron triggers

1. Pathlib Mastery

The `pathlib` library makes interacting with file directories seamless across Windows, macOS, and Linux.