Automate the Boring Stuff with Python

Practical Programming for Total Beginners
by Al Sweigart

April 2015, 504 pp.
ISBN: 978-1-59327-599-0

“The best part of programming is the triumph of seeing the machine do something useful. Automate the Boring Stuff with Python frames all of programming as these small triumphs; it makes the boring fun.”
Hilary Mason, Founder of Fast Forward Labs and Data Scientist in Residence at Accel

Wil Wheaton on reading Automate the Boring Stuff with Python: “I’m having a lot of fun breaking things and then putting them back together, and just remembering the joy of turning a set of instructions into something useful and fun, like I did when I was a kid.”

Automate the Boring Stuff with Python is recommended on the Open Source Summer 2015 Reading List!

If you’ve ever spent hours renaming files or updating hundreds of spreadsheet cells, you know how tedious tasks like these can be. But what if you could have your computer do them for you?
In Automate the Boring Stuff with Python, you’ll learn how to use Python to write programs that do in minutes what would take you hours to do by hand—no prior programming experience required. Once you’ve mastered the basics of programming, you’ll create Python programs that effortlessly perform useful and impressive feats of automation to:

  • Search for text in a file or across multiple files
  • Create, update, move, and rename files and folders
  • Search the Web and download online content
  • Update and format data in Excel spreadsheets of any size
  • Split, merge, watermark, and encrypt PDFs
  • Send reminder emails and text notifications
  • Fill out online forms

Step-by-step instructions walk you through each program, and practice projects at the end of each chapter challenge you to improve those programs and use your newfound skills to automate similar tasks.
Don’t spend your time doing work a well-trained monkey could do. Even if you’ve never written a line of code, you can make your computer do the grunt work. Learn how in Automate the Boring Stuff with Python.
Note: The programs in this book are written to run on Python 3.


About the Author

Al Sweigart is a software developer and teaches programming to kids and adults. He has written several Python books for beginners, including Hacking Secret Ciphers with Python, Invent Your Own Computer Games with Python, and Making Games with Python & Pygame.


Table of Contents

Introduction
Part I: Python Programming Basics
Chapter 1: Python Basics
Chapter 2: Flow Control
Chapter 3: Functions
Chapter 4: Lists
Chapter 5: Dictionaries and Structuring Data
Chapter 6: Manipulating Strings
Part II: Automating Tasks
Chapter 7: Pattern Matching with Regular Expressions
Chapter 8: Reading and Writing Files
Chapter 9: Organizing Files
Chapter 10: Debugging
Chapter 11: Web Scraping
Chapter 12: Working with Excel Spreadsheets
Chapter 13: Working with PDF and Word Documents
Chapter 14: Working with CSV Files and JSON Data
Chapter 15: Keeping Time, Scheduling Tasks, and Launching Programs
Chapter 16: Sending Email and Text Messages
Chapter 17: Manipulating Images
Chapter 18: Controlling the Keyboard and Mouse with GUI Animation
A: Installing Third-Party Modules
B: Running Programs
C: Answers to the Practice Questions
View the detailed Table of Contents (PDF)
View the Index (PDF)

(top)

Reviews

“Do you need Automate the Boring Stuff with Python? Yes, if you want to enhance your workflow by using automation, this is an excellent place to start. Highly recommended.”
Network World

Listen to an interview with Al Sweigart about Automate the Boring Stuff with Python on the Talk Python to Me podcast!

“Valuable to have on your shelf...an extremely useful book.”
Kids, Code, and Computer Science Magazine

“​Written in easy to understand language with a gentle approach...Automate the Boring Stuff with Python is the perfect manual to get your computer doing the busywork.”
Games Fiends

Read an interview with Al Sweigart on the Import Python blog!

Al Sweigart was interviewed about practical programming on the Test Talks podcast with Joe Colantonio.

Al Sweigart offers tips on Practical Programming for Non-Engineers on Opensource.com.

Read Al Sweigart's advice on Opensource.com for teaching kids how to code.

Al Sweigart chronicles 6 time-consuming tasks you can automate with code, on Opensource.com.

"Automate the Boring Stuff with Python is perfect for anyone who has menial tasks they don't want to spend hours doing."
GeekMom

"One of the best books for learning Python."
Giles McMullen-Klein, FlickThrough Reviews

(top)

Updates

(show updates)(top)