252 kr
Beställningsvara. Skickas inom 5-8 vardagar. Fri frakt över 249 kr.
Beskrivning
Streamline Your Workflow and Boost Productivity with Python Automation In today's workplaces, there's a high demand for know-how on the Python programming language, especially for writing time-saving scripts that can simplify routine work tasks. Python Automation For Dummies delivers, with simple explanations of how you can use Python to automatically wrangle data files, manage media files, create shortcuts, find and organize web data, and even analyze social media for trends. With this easy-to-follow Dummies guide, you can upskill, expand your productivity, and speed up the process of generating data-driven insights. You'll even learn to enhance your Python automations with AI, for workflows that are faster and smarter. Review the basics of Python coding and follow steps for automating all sorts of tasksManage large file sets, organize and analyze data, and speed up research processesAutomate scheduling and other time-consuming tasks—and optimize work with AIFree up time and resources by automating routine work, so you can foucs on more important issuesThis is a great Dummies resource for Python developers interested in applying the popular coding language to make workflows more efficient.
Produktinformation
- Utgivningsdatum:2025-12-04
- Mått:240 x 20 x 190 mm
- Vikt:690 g
- Format:Häftad
- Språk:Engelska
- Antal sidor:368
- Förlag:John Wiley & Sons Inc
- ISBN:9781394371426
Utforska kategorier
Mer om författaren
Alan Simpson is a veteran technology writer and educator with extensive experience covering topics from programming languages to the Windows operating system. He’s the author of Windows 11 For Dummies, 2nd Edition, and a co-author of Python All-in-One For Dummies.
Innehållsförteckning
- Introduction 1About This Book 1Foolish Assumptions 2Icons Used in This Book 2Beyond the Book 2Where to Go from Here 3Part 1: Getting Started with Python Automation 5Chapter 1: Automating with Python 7Choosing a Programming Language 8Understanding Python Syntax 10Getting Python 11Identifying the hardware requirements 11Installing Python 12Chapter 2: Choosing a Code Editor 15Installing VS Code 16Installing Python Extensions 18Creating a Folder for a New Project 19Opening a project’s folder in VS Code 20Selecting your Python version 21Opening the Terminal in VS Code 22Checking your Python version 23Using Virtual Environments 24Creating a virtual environment 25Activating a virtual environment 26Installing Modules 28Writing and Running Python Scripts 30Writing a Python script 30Running a Python script 32Chapter 3: Python Basics for Automation 35Understanding Python Comments 35Mastering Variables and Data Types 36Working with numbers 37Working with text (strings) 38Deciding true or false with Booleans 39Using lists 39Making immutable lists with tuples 40Defining key–value pairs in dictionaries 40Leaving things hanging with None 41Formatting Output 42Dealing with Dates and Times 45Manipulating Data with Operators 47Using arithmetic and string operators 47Using assignment operators 48Recognizing other operators 49Getting Loopy with Loops 51Looping with for 51Looping for a while 52Bailing out of loops 53Making Decisions 55Deciding with if else 55Compacting decisions with a ternary operator 56Deciding with match 57Defining Python Functions 58Defining default values for parameters 60Using type hints in Python functions 60Creating Classes and Objects 61Handling Exceptions 63Part 2: Automating Common Computer Tasks 67Chapter 4: Automating Files and Folders 69Demystifying the Buzzwords 70Drives, directories, folders, and files 71Absolute versus relative paths 72Backslashes in Windows paths 73Playing It Safe 74Navigating Folders and Files 74Organizing Files by Type 81Using mkdir for subfolders 86Moving files with shutil 86Making the script your own 87Renaming Files in Bulk 87Renaming files with Python 90Using the bulk renaming script 91Chapter 5: Automating File Management 93Deleting Old and Temporary Files 93Identifying old files 96Matching the file pattern 96Sending files to the trash 97Using the deletion script safely 97Backing Up Files 98Creating folders from Python 101Copying files with Python 101Personalizing the backup script 102Finding and Removing Duplicate Files 103Calculating a file hash 106Finding duplicate files 107Deleting duplicate files 108Tweaking the find duplicates script 108Compressing Files 109Compressing files with Python 112Setting your compression parameters 113Decompressing Files 114Unzipping files with Python 116Using the decompression script 117Chapter 6: Automating Image and Video Files 119Resizing, Rotating, Flipping, and Cropping Images 120Resizing images 125Rotating images 126Flipping images 126Cropping images 127Customizing the image processor 128Converting Image File Types 129Converting files with Python 131Personalizing the conversion script 132Extracting Frames from Video Files 133Importing modules for video extraction 135Looping through a video 136Tweaking the video conversion script 138Chapter 7: Automating Mouse and Keyboard 139Granting Permissions on a Mac 140Moving the Mouse, Clicking, Dragging, and Scrolling 141Understanding screen coordinates 141Controlling the mouse speed 141Stopping a wild mouse 142Finding the screen locations of things 142Using mouse control with a specific app 144Trying out mouse control 144Typing Text with Python 146Controlling the typing speed 147Typing long passages of text 147Pressing special keys 148Pressing hotkeys 148Detecting the operating system 149Detecting Keystrokes 150Creating Your Own Keyboard Shortcuts 151Automating Screenshots 155Taking screenshots with Python 157Personalizing the auto screenshot script 158Chapter 8: Automating the Office 159Automating Microsoft Word 159Naming your Word document 162Defining your Word content 163Automating Microsoft Excel 164Specifying your workbook 167Defining content for your workbook 167Creating and Opening PDFs 168Defining content for your PDF 172Identifying your PDF 172Watermarking PDFs 173Creating your watermark image 176Adapting the script to your needs 177Part 3: Automating the Internet 179Chapter 9: Interacting with APIs 181Obtaining API Keys 181Safely Storing API Keys 182Creating a .gitignore file 184Using an API key in your script 185Handling JSON Data 185Parsing and serializing JSON data 187Reading and writing JSON files 188Understanding REST APIs 190Making API requests 191Parsing API responses 193Reviewing a Complete REST API Script 194Chapter 10: Automating the Web 197Automating Web Browsers 197Loading drivers for your browser 198Finding text boxes to fill 200Automating Filling Forms Online 201Finding a control 203Submitting a form with Enter 204Filling Multiple Text Boxes 204Clicking a form’s Submit button 207Adapting the script to your needs 207Filling Text Boxes from a File 208Chapter 11: Scraping Web Pages 213Picking the Right Tools for Web Scraping 213Scraping Links from a Web Page 214Sending a browser header 215Parsing a web page 216Extracting Data from a Web Page 217Finding elements to scrape 218Scraping data from the page 221Automating Data Extraction 222Determining whether a business is open 225Scraping stock market data 227Chapter 12: Automating Email and Text Messages 229Sending Bulk Email Automatically 229Collecting account information 230Creating a .env file 230Creating your email-sending script 231Sending HTML mail 234Putting email recipient addresses in a file 235Automatically Sending Text Messages 236Storing SMS account information 237Defining your recipient list and message 239Storing recipient numbers 239Chapter 13: Automating Social Media 243Acquiring API Keys and Modules 243Automating Posting 244Setting up your project 245Making the script your own 249Creating Content for Your Posts 249Tracking Performance Metrics 251Getting Instagram API access 251Setting up your script 251Defining your metrics and timeframe 254Analyzing Trends 255Viewing the trends 257Setting your own keywords and timeframe 257Part 4: Automating More Advanced Stuff 259Chapter 14: Scheduling Tasks. 261Using the Schedule Module 261Understanding how the schedule module works 263Scheduling tasks for intervals 264Using the APScheduler Module 265Using APScheduler with intervals 267Using APScheduler with dates and times 268Automating Python Scripts 271Running scripts as subprocesses 271Running scripts as imports 274Chapter 15: Integrating with Artificial Intelligence 277Accessing Free AI through an API 277Warming Up to a Local Chatbot 282Installing and running Ollama 283Downloading AI models with Ollama 283Building a simple local chatbot 284Creating a Conversational Chatbot 287Developing an AI Image Generator 290Showing the generated image onscreen 295Hitting up Hugging Face 301Part 5: the Part of Tens 309Chapter 16: Top Ten Zen of Python Guidelines 311Beautiful Is Better than Ugly 311Explicit Is Better than Implicit 314Using type hints 315Using comments 316Handling errors 316Simple Is Better than Complex 317Complex Is Better than Complicated 320Flat Is Better than Nested 321Flattening nested conditionals 321Using list comprehension 322Sparse Is Better than Dense 324Readability Counts 325Special Cases Aren’t Special Enough to Break the Rule 326Practicality Beats Purity 328Errors Should Never Pass Silently 329Chapter 17: Top Ten Python Error Messages 331Command Not Found 331No Module Named 333SyntaxError 334NameError 335TypeError 336IndexError 337KeyError 339AttributeError 340ModuleNotFoundError 342FileNotFoundError 343IndentationError 345Index 347