Skill area · Scripting & Automation

Let Python and AI do the boring work for you

Automate files, reports, websites, and everyday tasks

Renaming a hundred files, pulling numbers from a website, sending the weekly report: if you do it more than twice, a short Python script can do it for you. Real Python teaches you to write scripts and command-line tools you can trust, one practical task at a time.

What you’ll be able to do

Automate the tasks that eat your week

Python’s standard library and a handful of well-loved packages cover almost everything you’d want to automate. Real Python shows you how to use them with small, practical examples you can adapt right away.

Files and folders

Find, rename, move, back up, and compress files across whole directory trees without clicking through a file manager.

pathlibshutilzipfile

Command-line tools

Turn a one-off script into a reusable tool with options and help text, and run other programs from Python.

argparseTypersubprocess

Documents and data

Read and write CSV, JSON, Excel, and PDF files, and send the finished report by email.

csvopenpyxlpypdf

The web

Download files, call APIs, scrape pages, and drive a real browser to fill in forms and click through sites for you.

RequestsBeautiful SoupSelenium
Your roadmap

From your first script to tools you can rely on

Not sure where to start? Work through these learning paths in order. Each one mixes tutorials, video courses, quizzes, and exercises, and tracks your progress as you go.

  1. 1

    Files and File Streams

    Read and write files, navigate the file system with pathlib, and work with encodings, ZIP archives, and PDFs.

    21 resources · Start here

  2. 2

    Important Standard Library Modules

    Dates and times, JSON and CSV, regular expressions, subprocess, and argparse: the batteries-included toolkit behind most automation scripts.

    22 resources

  3. 3

    Exceptions, Logging, and Debugging

    Make scripts that run unattended fail gracefully, leave a useful log behind, and are easy to fix when something goes wrong.

    14 resources

  4. 4

    Python Web Scraping

    Make HTTP requests, parse HTML with Beautiful Soup, scale up with Scrapy, and automate a real browser with Selenium.

    19 resources

  5. DevOps With Python

    Run scripts anywhere, package and share them, and automate testing and deployment with CI/CD, Docker, and AWS.

    22 resources · Take it anytime

New to Python itself? Start with Python Basics first, then come back here.

Try it now

Find files by extension

This is a real exercise from the Practical Recipes for Working With Files in Python video course, and the first step toward a script like the one above. Write your function in the editor and click Run Tests.

Loading exercise...

Running tests, hints, and solutions are included with a Real Python membership. Not a member yet? You can still read the task and write your solution before you join.

Learn it every way

Read it, watch it, test it, practice it

Every automation topic comes in the formats that help it stick. Mix them however you like.

Mentor AI

Script not doing what you expected? Ask right where you are

Automation code tends to fail quietly: a path that’s relative to the wrong folder, a glob that matches nothing, a PermissionError halfway through a batch of files.

Mentor AI sees the tutorial, lesson, or exercise you’re on and your code, and nudges you toward the fix one hint at a time, so you understand what your script is actually doing.

Meet Mentor AI →
The automation toolkit

Learn the tools that get the job done

Most of what you need ships with Python. The rest is a pip install away.

Fresh from the library

New and updated for 2026

The Real Python team keeps publishing and refreshing automation content, so what you learn matches the tools and Python versions you’ll use every day.

Explore the standard library path →

Questions and answers

Do I need to know Python before I start?

You should be comfortable with Python basics like variables, lists, loops, and functions. If you’re not there yet, the Python Basics learning path gets you ready, and many first automation scripts use nothing more than what it covers.

What’s the difference between a script and a program?

Mostly size and intent. A script is usually a single file that does one job, like tidying a folder. As you add options, error handling, and logging, it grows into a tool others can use. This roadmap covers both steps. To get comfortable running your code, start with How to Run Your Python Scripts and Code.

Should I use argparse, Click, or Typer for command-line tools?

Start with argparse. It ships with Python, so your script runs anywhere without extra installs. When your tool grows several subcommands, Click and Typer save you a lot of boilerplate.

Is web scraping allowed?

It depends on the site. Always check its terms of service and robots.txt, prefer an official API when one exists, and keep your request rate polite. The Python Web Scraping path covers these ground rules before you write your first scraper.

What’s included in a membership?

Every Real Python membership includes all video courses, quizzes, coding exercises, and learning paths for automation and every other topic, along with Mentor AI as it rolls out.

Stop doing it by hand

Get your free learning plan and follow the full scripting and automation roadmap, with courses, quizzes, coding exercises, and a mentor at your side.