Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Al Sweigart

Rating No ratings yet

NOTE: This is the older first edition. The third edition is now available for this book. 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.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on, beginner-friendly guide that teaches Python by automating real-world tasks like file management, web scraping, and spreadsheet editing—perfect for office workers, hobbyists, and anyone who has never coded but wants to save hours of tedious manual work. 【Book Arc】 - **Opening (~0%–10%)**: Introduces the book's promise—automating boring tasks with Python—and lays out the full table of contents, from basic syntax to GUI automation. This stage sets expectations for a practical, project-driven journey. - **Early (~10%–32%)**: Covers Python fundamentals: variables, data types, flow control (if/else, loops), functions, lists, dictionaries, and string manipulation. Each concept is tied to small examples, building a solid base for later automation. - **Middle (~32%–48%)**: Transitions into Part II, "Automating Tasks," starting with pattern matching using regular expressions and then file reading/writing. This is where the book shifts from learning syntax to solving concrete problems. - **Late (~48%–75%)**: Dives into practical automation: organizing files, debugging, web scraping, working with Excel spreadsheets, PDFs, Word documents, CSV/JSON data, and scheduling tasks. Each chapter is a standalone toolkit for a common office chore. - **Ending (~75%–100%)**: Covers sending emails/texts, manipulating images, and controlling the keyboard/mouse with GUI automation. The book closes with appendices on installing modules, running programs, and practice answers, reinforcing self-sufficiency. 【Key Takeaways】 - **Python basics are the gateway to automation** (Early): Mastering variables, loops, and functions is non-negotiable, but the book keeps it light with examples like a Magic 8 Ball, making the learning curve gentle for total beginners. - **Regular expressions turn messy text into structured data** (Middle): Learning regex patterns (e.g., grouping, character classes, greedy matching) lets you search and extract text across files—a core skill for automating data entry or log analysis. - **File handling is the heart of office automation** (Middle): Understanding paths, reading/writing files, and using the `shelve` module to save data prepares you to manipulate documents, rename batches, and organize folders without manual effort. - **Web scraping opens the door to online data** (Late): With Python, you can download web content and extract information automatically, turning repetitive copy-paste tasks into one-click scripts. - **Excel and PDF manipulation save hours of spreadsheet drudgery** (Late): The book shows how to update, format, split, merge, and encrypt files programmatically—ideal for anyone who lives in Office documents. - **Scheduling and notifications keep automation running without you** (Late): By learning to time tasks, launch programs, and send emails/texts, you can build scripts that work while you sleep, from reminders to batch reports. - **GUI automation handles what code can't reach** (Ending): Controlling the keyboard and mouse lets you automate legacy apps or web forms that lack APIs, making your Python skills universal across software. 【Reading Tips】 - **Skim the early chapters if you've coded before**: Chapters 1–6 are essential for true beginners, but experienced programmers can jump to Chapter 7 (regex) and beyond for the automation meat. - **Deep-read the practice projects**: End-of-chapter projects like "Password Locker" or "Adding Bullets to Wiki Markup" are where the learning sticks—don't skip them; they're small enough to finish in one sitting. - **Watch for the "Project" sections in later chapters**: These step-by-step walkthroughs (e.g., web scraping or Excel updates) are the book's core value; read them with a computer nearby to type along. - **Use the appendices as a safety net**: If you get stuck on installing modules or running scripts, Appendix A and B are quick references—check them before Googling. - **Treat this as a reference, not a novel**: After the first read, keep it on your desk; the chapter structure makes it easy to revisit specific tasks (e.g., PDFs or emails) when you need them. 【Coverage Limits】 This guide synthesizes the book's structure and key themes from the table of contents and early chapter outlines; it does not cover detailed code examples, specific project outputs, or the third edition's updates, which are not present in the excerpts.
Page 1
e. But what if you could have your computer do them for you? minutes what would take you hours to do by hand— learn how to use Python to write programs that...
View in text
Page 7
. . . . . . 447 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 C o n t e n...
View in text
Page 11
th the append() and insert() Methods . . . . . . . . . . . . 89 Removing Values from Lists with remove() . . . . . . . . . . . . . . . . . . . . . . . . . ....
View in text
Page 12
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Matching Everything with Dot-Star . . . . . . . . . . . . . . . . . . . . . ....
View in text
Page 14
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
View in text
Page 13
. . . . . . . . . . . . 281 Ideas for Similar Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 Setting the Font Style of...
View in text
Page 18
on . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 Opening Websites with Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
View in text
Page 19
ndividual Pixels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 Project: Adding a Logo . . . . . . . . . . . . . . . . . . . . ....
View in text
Tags
AI categories
Programming LanguagePythonTechnology
ISBN: 1593275994
Publisher: No Starch Press
Publish Year: 2015
Language: English
Pages: 504
File Format: PDF
File Size: 16.6 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…