📄 Page
1
(This page has no text content)
📄 Page
2
Python at Work: Automate Your Way to 5 PM Adrian Westbrook Published by Adrian Westbrook, 2025. OceanofPDF.com
📄 Page
3
While every precaution has been taken in the preparation of this book, the publisher assumes no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. PYTHON AT WORK: AUTOMATE YOUR WAY TO 5 PM First edition. July 1, 2025. Copyright © 2025 Adrian Westbrook. Written by Adrian Westbrook. OceanofPDF.com
📄 Page
4
TABLE OF CONTENTS Title Page Copyright Page Python at Work: Automate Your Way to 5 PM Part 1: Getting Started with Python for Automation | Chapter 1: Welcome to the World of Automation Chapter 2: First Steps in Python: The Basics You Need Chapter 3: Mastering Essential Data Structures Part 2: Automating Common Office Tasks | Chapter 4: Working with Files and Folders Chapter 5: Manipulating Spreadsheets (Excel) Chapter 6: Working with PDFs Chapter 7: Working with Word Documents Chapter 8: Sending and Receiving Emails Part 3: Advanced Automation Techniques | Chapter 9: Web Scraping with Python Chapter 10: Automating GUI Interactions (Mouse and Keyboard) Chapter 11: Working with APIs Chapter 12: Scheduling Your Automations Part 4: Building Your Automation Toolkit | Chapter 13: Error Handling and Debugging Chapter 14: Creating Reusable Code: Functions and Modules Chapter 15: Best Practices for Robust Automation
📄 Page
5
Appendix Appendix A: Useful Python Libraries for Automation Appendix B: Common Error Messages and How to Fix Them Appendix C: Resources for Further Learning About the Author OceanofPDF.com
📄 Page
6
Python at Work: Automate Your Way to 5 PM Adrian Westbrook 2025-07-01T23:02:24Z
📄 Page
7
(This page has no text content)
📄 Page
8
PYTHON AT WORK: AUTOMATE YOUR WAY TO 5 PM OceanofPDF.com
📄 Page
9
(This page has no text content)
📄 Page
10
PART 1: GETTING STARTED WITH PYTHON FOR AUTOMATION
📄 Page
11
CHAPTER 1: WELCOME TO THE WORLD OF AUTOMATION • 1.1. Why Automate? The Power of Efficiency – 1.1.1. Reclaiming Your Time – 1.1.2. Reducing Errors and Tedium – 1.1.3. Focusing on More Important Tasks • 1.2. Your New Superpower: Python – 1.2.1. What is Python and Why is it Great for Automation? – 1.2.2. A Glimpse into Python’s Versatility • 1.3. Setting Up Your Python Environment – 1.3.1. Installing Python – 1.3.2. Choosing and Using a Code Editor (VS Code, PyCharm, Sublime Text) – 1.3.3. Understanding the Command Line Interface (CLI) – 1.3.4. Installing Packages with pip OceanofPDF.com
📄 Page
12
(This page has no text content)
📄 Page
13
CHAPTER 2: FIRST STEPS IN PYTHON: THE BASICS YOU NEED • 2.1. Your First Python Program: “Hello, World!” • 2.2. Variables and Data Types – 2.2.1. Numbers (Integers and Floats) – 2.2.2. Strings (Text) – 2.2.3. Booleans (True/False) • 2.3. Basic Operations – 2.3.1. Arithmetic Operators – 2.3.2. String Concatenation and Repetition • 2.4. Input and Output – 2.4.1. Getting User Input (input()) – 2.4.2. Displaying Output (print()) • 2.5. Control Flow: Making Decisions – 2.5.1. Conditional Statements (if, elif, else) – 2.5.2. Comparison and Logical Operators • 2.6. Loops: Repeating Actions – 2.6.1. for Loops – 2.6.2. while Loops – 2.6.3. break and continue OceanofPDF.com
📄 Page
14
(This page has no text content)
📄 Page
15
CHAPTER 3: MASTERING ESSENTIAL DATA STRUCTURES • 3.1. Lists: Ordered Collections – 3.1.1. Creating, Accessing, and Modifying Lists – 3.1.2. List Methods (append, insert, remove, sort, etc.) – 3.1.3. Slicing Lists • 3.2. Tuples: Immutable Sequences – 3.2.1. When to Use Tuples • 3.3. Dictionaries: Key-Value Pairs – 3.3.1. Creating, Accessing, and Modifying Dictionaries – 3.3.2. Dictionary Methods (keys, values, items) • 3.4. Sets: Unique Collections – 3.4.1. Set Operations OceanofPDF.com
📄 Page
16
(This page has no text content)
📄 Page
17
PART 2: AUTOMATING COMMON OFFICE TASKS
📄 Page
18
CHAPTER 4: WORKING WITH FILES AND FOLDERS • 4.1. Navigating Your File System with Python – 4.1.1. The os Module: Core File Operations – 4.1.2. Current Working Directory – 4.1.3. Listing Files and Directories – 4.1.4. Creating, Renaming, and Deleting Files/Folders • 4.2. Organizing Your Digital Life – 4.2.1. Batch Renaming Files – 4.2.2. Moving and Copying Files – 4.2.3. Deleting Empty Folders – 4.2.4. Creating Folder Structures • 4.3. Walking Through Directory Trees (os.walk()) • 4.4. Paths and File Names: The pathlib Module – 4.4.1. A Modern Approach to File Paths OceanofPDF.com
📄 Page
19
(This page has no text content)
📄 Page
20
CHAPTER 5: MANIPULATING SPREADSHEETS (EXCEL) • 5.1. Introduction to Spreadsheet Automation • 5.2. Reading Excel Files with pandas – 5.2.1. Installing pandas – 5.2.2. Loading Workbooks and Sheets – 5.2.3. Selecting and Filtering Data – 5.2.4. Basic Data Analysis • 5.3. Writing to Excel Files with pandas – 5.3.1. Creating New Spreadsheets – 5.3.2. Exporting DataFrames – 5.3.3. Adding Multiple Sheets • 5.4. Advanced Excel Tasks – 5.4.1. Formatting Cells – 5.4.2. Working with Formulas – 5.4.3. Merging and Appending DataFrames OceanofPDF.com