The second edition of Automate the Boring Stuff with Python is now available online under a Creative Commons license. This book teaches programming to complete beginners with no previous experience. The first edition was published in 2015. This blog post outlines the new content in the second edition with links to the content online so that readers of the first edition can immediately find the new content.

You can also buy a print book from the publisher, No Starch Press, and receive PDF/Kindle/epub ebooks for free with purchase (something you won't get from Amazon).

There are many small edit throughout the book, but here are the new sections:

Introduction

You Are Not Too Old to Learn Programming - A short section to remind you that you're not too old to learn to program, just like you don't need to be good at math to program.

Downloading and Installing Mu - You can use IDLE (which comes with Python) to type your code

Chapter 1 - Python Basics

No new sections.

Chapter 2 - Flow Control

Chapter 3 - Functions

The Call Stack - Understanding the call stack helps you develop a mental model for function calls and scopes.

A Short Program: Zigzag - A fun animation program.

Chapter 4 - Lists

Chapter 5 - Dictionaries and Structuring Data

Chess Dictionary Validator - A practice project to write code to ensure a dictionary for a chess board is well-formed.

Chapter 6 - Manipulating Strings

Project: Multi-Clipboard Automatic Messages - The "password locker" project has been changed to a similar "multi-clipboard" project, since I don't want to encourage readers to keep their passwords in plain text on their hard drives.

A Short Program: Pig Latin - A fun program to turn English into Pig Latin.

Zombie Dice Bots - A practice project to write bots to play a game called, "Zombie Dice"

Chapter 7 - Pattern Matching with Regular Expressions

Date Detection - A practice project to use regex to make sure date strings are properly formatted.

Chapter 8 - Input Validation

Chapter 9 - Reading and Writing Files

Files and File Paths - This entire chapter has been rewritten to use the new pathlib module and Path objects for file paths.

module and objects for file paths. Using the / Operator to Join Paths - The / operator can join Path objects.

Chapter 10 - Organizing Files

No new sections.

Chapter 11 - Debugging

Mu's Debugger - Since the second edition uses the Mu editor instead of IDLE, the debugging chapter covers Mu's debugger.

Chapter 12 - Web Scraping

Project: Opening All Search Results - A project to search the Python Package Index and automatically open each search result link.

Chapter 13 - Working with Excel Spreadsheets

No new sections.

Chapter 14 - Working with Google Sheets

Chapter 15 - Working with PDF and Word Documents

No new sections.

Chapter 16 - Working with CSV Files and JSON Data

No new sections.

Chapter 17 - Keeping Time, Scheduling Tasks, and Launching Programs

No new sections.

Chapter 18 - Sending Email and Text Messages

Chapter 19 - Manipulating Images

No new sections.

Chapter 20 - Controlling the Keyboard and Mouse with GUI Automation