Automate The Boring Stuff PDF Free Download

Share on facebook
Share on whatsapp
Share on twitter
Share on telegram
Automate the Boring Stuff with Python

Automate the Boring Stuff with Python Summary

Automate the Boring Stuff with Python: The second edition of this best-selling Python book (over 500,000 copies sold!) uses Python 3 to teach even the technically uninclined how to write programs that do in minutes what would take hours to do by hand. There is no prior programming experience required and the book is loved by liberal arts majors and geeks alike.

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 this fully revised second edition of the best-selling classic 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. You’ll learn the basics of Python and explore Python’s rich library of modules for performing specific tasks, like scraping data off websites, reading PDF and Word documents, and automating clicking and typing tasks.

The second edition of this international fan-favorite includes a brand-new chapter on input validation, as well as tutorials on automating Gmail and Google Sheets, plus tips on automatically updating CSV files. You’ll learn how to create programs that effortlessly perform useful 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 email responses and text notifications
  • Fill out online forms

Step-by-step instructions walk you through each program and updated 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 to Automate the Boring Stuff with Python, 2nd Edition.

About the Author

Al Sweigart is a software developer and tech book author living in San Francisco. He has written several programming books for beginners, including Automate the Boring Stuff with Python, also from No Starch Press. His books are freely available under a Creative Commons license at his website

Automate the Boring Stuff with Python Introduction

Excerpt. © Reprinted by permission. All rights reserved.

“You’ve just done in two hours what it takes the three of us two days to do.” My college roommate was working at a retail electronics store in the early 2000s. Occasionally, the store would receive a spreadsheet of thousands of product prices from other stores. A team of three employees would print the spreadsheet onto a thick stack of paper and split it among themselves. For each product price, they would look up their store’s price and note all the products that their competitors sold for less. It usually took a couple of days.

“You know, I could write a program to do that if you have the original file for the printouts,” my roommate told them when he saw them sitting on the floor with papers scattered and stacked all around.

After a couple of hours, he had a short program that read a competitor’s price from a file, found the product in the store’s database, and noted whether the competitor was cheaper. He was still new to programming, so he spent most of his time looking up documentation in a programming book. The actual program took only a few seconds to run. My roommate and his co-workers took an extra-long lunch that day.

This is the power of computer programming. A computer is like a Swiss Army knife that you can configure for countless tasks. Many people spend hours clicking and typing to perform repetitive tasks, unaware that the machine they’re using could do their job in seconds if they gave it the right instructions.

Whom Is This Book For?

Software is at the core of so many of the tools we use today: nearly everyone uses social networks to communicate, many people have internet-connected computers in their phones, and most office jobs involve interacting with a computer to get work done. As a result, the demand for people who can code has skyrocketed. Countless books, interactive web tutorials, and developer boot camps promise to turn ambitious beginners into software engineers with six-figure salaries.

This book is not for those people. It’s for everyone else.

On its own, this book won’t turn you into a professional software developer any more than a few guitar lessons will turn you into a rock star. But if you’re an office worker, administrator, academic, or anyone else who uses a computer for work or fun, you will learn the basics of programming so that you can automate simple tasks such as these:

  • Moving and renaming thousands of files and sorting them into folders
  • Filling out online forms—no typing required
  • Downloading files or copying text from a website whenever it updates
  • Having your computer text you custom notifications
  • Updating or formatting Excel spreadsheets
  • Checking your email and sending out prewritten responses

These tasks are simple but time-consuming for humans, and they’re often so trivial or specific that there’s no ready-made software to perform them. Armed with a little bit of programming knowledge, however, you can have your computer do these tasks for you.


This book is not designed as a reference manual; it’s a guide for beginners. The coding style sometimes goes against best practices (for example, some programs use global variables), but that’s a trade-off to make the code simpler to learn. This book is made for people to write throwaway code, so there’s not much time spent on style and elegance. Sophisticated programming concepts—like object-oriented programming, list comprehensions, and generators—aren’t covered because of the complexity they add. Veteran programmers may point out ways the code in this book could be changed to improve efficiency, but this book is mostly concerned with getting programs to work with the least amount of effort on your part.

What Is Programming?

Television shows and films often show programmers furiously typing cryptic streams of 1s and 0s on glowing screens, but modern programming isn’t that mysterious. Programming is simply the act of entering instructions for the computer to perform. These instructions might crunch some numbers, modify the text, look up information in files, or communicate with other computers over the internet.

All programs use basic instructions as for building blocks. Here are a few of the most common ones, in English:

  • “Do this; then do that.”
  • “If this condition is true, perform this action; otherwise, do that action.”
  • “Do this action exactly 27 times.”
  • “Keep doing that until this condition is true.”

You can combine these building blocks to implement more intricate decisions, too. For example, here are the programming instructions, called the source code, for a simple program written in the Python programming language. Starting at the top, the Python software runs each line of code (some lines are run only if a certain condition is true or else Python runs some other line) until it reaches the bottom.

➊ passwordFile = open(‘SecretPasswordFile.txt’)
➋ secretPassword =
➌ print(‘Enter your password.’)
   typedPassword = input()
➍ if typedPassword == secretPassword:
   ➎ print(‘Access granted’)
   ➏ if typedPassword == ‘12345’:
       ➐ print(‘That password is one that an idiot puts on their luggage.’)
   ➑ print(‘Access denied’)

You might not know anything about programming, but you could probably make a reasonable guess at what the previous code does just by reading it. First, the file SecretPasswordFile.txt is opened ➊, and the secret password in it is read ➋. Then, the user is prompted to input a password (from the keyboard) ➌. These two passwords are compared ➍, and if they’re the same, the program prints Access granted to the screen ➎. Next, the program checks to see whether the password is 12345 ➏ and hints that this choice might not be the best for a password ➐. If the passwords are not the same, the program prints Access denied to the screen ➑.

What Is Python?

Python is a programming language (with syntax rules for writing what is considered valid Python code) and the Python interpreter software that reads source code (written in the Python language) and performs its instructions. You can download the Python interpreter for free at, and there are versions for Linux, macOS, and Windows.

The name Python comes from the surreal British comedy group Monty Python, not from the snake. Python programmers are affectionately called Pythonistas, and both Monty Python and serpentine references usually pepper Python tutorials and documentation.

Programmers Don’t Need to Know Much Math

The most common anxiety I hear about learning to program is the notion that it requires a lot of math. Actually, most programming doesn’t require math beyond basic arithmetic. In fact, being good at programming isn’t that different from being good at solving Sudoku puzzles.

To solve a Sudoku puzzle, the numbers 1 through 9 must be filled in for each row, each column, and each 3×3 interior square of the full 9×9 board. Some numbers are provided to give you a start, and you find a solution by making deductions based on these numbers. In the puzzle shown in Figure 0-1, since 5 appears in the first and second rows, it cannot show up in these rows again. Therefore, in the upper-right grid, it must be in the third row.

Since the last column also already has a 5 in it, the 5 cannot go to the right of the 6, so it must go to the left of the 6. Solving one row, column, or square will provide more clues to the rest of the puzzle, and as you fill in one group of numbers 1 to 9 and then another, you’ll soon solve the entire grid.

This site complies with DMCA Digital Copyright Laws. Please bear in mind that we do not own copyrights to this book/software. We are not hosting any copyrighted content on our servers, it’s a catalog of links that have already been found on the internet. doesn’t have any material hosted on the server of this page, only links to books that are taken from other sites on the web are published and these links are unrelated to the book server. Moreover, server does not store any type of book, guide, software, or images. No illegal copies are made or any copyright © and/or copyright is damaged or infringed since all material is free on the internet. Check out our DMCA Policy. If you feel that we have violated your copyrights, then please contact us immediately. We’re sharing this with our audience ONLY for educational purposes and we highly encourage our visitors to purchase original licensed software/Books. If someone with copyrights wants us to remove this software/Book, please contact us. immediately.

You may send an email to for all DMCA / Removal Requests.

For More Computers Books

Automate the Boring Stuff with Python

Automate the Boring Stuff with Python PDF

Product details:

EditionInternational Edition
ISBN1593279922, 978-1593279929
Posted onNovember 12, 2019
Page Count592 pages
AuthorAl Sweigart

Automate The Boring Stuff PDF Free Download - Epicpdf

Automate the Boring Stuff with Python: The second edition of this best-selling Python book (over 500,000 copies sold!) uses Python 3 to teach even the technically uninclined how to write programs that do in minutes what would take hours to do by hand. There is no prior programming experience required and the book is loved by liberal arts majors and geeks alike.


Author: Al Sweigart

Editor's Rating:

Recent Books

Audible Plus Free

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.